MCPcopy Index your code
hub / github.com/hpcloud/tail / readLine

Method readLine

tail.go:210–224  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

208}
209
210func (tail *Tail) readLine() (string, error) {
211 tail.lk.Lock()
212 line, err := tail.reader.ReadString('\n')
213 tail.lk.Unlock()
214 if err != nil {
215 // Note ReadString "returns the data read before the error" in
216 // case of an error, including EOF, so we return it as is. The
217 // caller is expected to process it if err is EOF.
218 return line, err
219 }
220
221 line = strings.TrimRight(line, "\n")
222
223 return line, err
224}
225
226func (tail *Tail) tailFileSync() {
227 defer tail.Done()

Callers 1

tailFileSyncMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected