Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLineLengths ¶
GetLineLengths counts the number of characters on each line of a file or string, returning a slice containing the length of each line in sequence.
Lines are defined to be separated by newline ('\n') characters. If the newline character is preceded by a carriage return ('\r'), this will also be treated as part of the separator.
If filePath is not empty, the function attempts to count the lines of the file at that path, otherwise lines in sourceString are counted.
Note: there may not be much useful information to be gathered by distinguishing between line lengths when they get very long. It may be pragmatic to just report all lines above e.g. 64K as 64K long.
Types ¶
This section is empty.