@@ -105,7 +105,7 @@ var (
105
105
// findFileMarker finds the next file marker in data,
106
106
// extracts the file name, and returns the data before the marker,
107
107
// the file name, and the data after the marker.
108
- // useCRLF states if \n or \r\n should be treated as a line separator .
108
+ // lineSep states if \n or \r\n should be appended by fixNL .
109
109
// If there is no next marker, findFileMarker returns before = fixNL(data), name = "", after = nil.
110
110
func findFileMarker (data , lineSep []byte ) (before []byte , name string , lineSeparator []byte , after []byte ) {
111
111
var i int
@@ -122,9 +122,8 @@ func findFileMarker(data, lineSep []byte) (before []byte, name string, lineSepar
122
122
}
123
123
124
124
// isMarker checks whether data begins with a file marker line.
125
- // If so, it returns the name from the line and the data after the line.
126
- // Otherwise it returns name == "" with an unspecified after.
127
- // useCRLF states if \n or \r\n should be treated as a line separator.
125
+ // If so, it returns the name from the line, used line separator and the data after the line.
126
+ // Otherwise it returns name == "" with unspecified lineSeparator and after.
128
127
func isMarker (data []byte ) (name string , lineSeparator , after []byte ) {
129
128
if ! bytes .HasPrefix (data , marker ) {
130
129
return "" , lineSeparator , nil
@@ -145,7 +144,7 @@ func isMarker(data []byte) (name string, lineSeparator, after []byte) {
145
144
}
146
145
147
146
// If data is empty or ends in lineSeparator, fixNL returns data.
148
- // useCRLF states if \n or \r\n should be treated as a line separator.
147
+ // lineSeparator states if \n or \r\n should be appended as a line separator if it is not present .
149
148
// Otherwise fixNL returns a new slice consisting of data with a final lineSeparator added.
150
149
func fixNL (data , lineSeparator []byte ) []byte {
151
150
if len (data ) == 0 || bytes .HasSuffix (data , crlf ) || bytes .HasSuffix (data , lf ) {
0 commit comments