1
0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-11-24 01:12:02 +01:00
go-gemini/util.go

17 lines
251 B
Go
Raw Normal View History

2020-09-21 23:23:51 +02:00
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
}