File: util.go

package info (click to toggle)
golang-github-showmax-go-fqdn 1.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, bullseye, bullseye-backports, forky, sid, trixie
  • size: 176 kB
  • sloc: makefile: 2
file content (20 lines) | stat: -rw-r--r-- 303 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package fqdn

import (
	"bufio"
	"io"
)

// Read lines from r. It strips the line terminators and handles case when last
// line is not terminated.
func readline(r *bufio.Reader) (string, error) {
	s, e := r.ReadString('\n')

	if e == io.EOF && len(s) != 0 {
		e = nil
	}

	s = chomp(s)

	return s, e
}