1
0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-11-23 21:02:28 +01:00
go-gemini/util.go
2020-09-21 17:23:51 -04:00

17 lines
251 B
Go

package gemini
import (
"bufio"
"io"
)
// readLine reads a line.
func readLine(r io.Reader) (string, error) {
scanner := bufio.NewScanner(r)
scanner.Scan()
if err := scanner.Err(); err != nil {
return "", err
}
return scanner.Text(), nil
}