Powerful Command-Line Applications in Go: confusing reference to "Split() function" (page 4)

The book says “we instruct the scanner to read words instead by setting the Split() function of the scanner”. But what is really done is set the ‘split function’ of the scanner. ‘Split()’ is not itself the split function, but the method that sets the split function.

From the docs:

func (s *Scanner) Split(split SplitFunc)
    Split sets the split function for the Scanner. The default split function is
    ScanLines.
1 Like

Hello @outofphase .

Thanks again for your suggestions. I agree the explanation can be improved. Fortunately the effect is the same.

I’ll improve the text for the next version.

Thanks,
Ricardo