mirror of
https://git.sr.ht/~adnano/go-gemini
synced 2024-11-24 01:12:02 +01:00
17 lines
251 B
Go
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
|
||
|
}
|