license/stdin.go

23 lines
248 B
Go
Raw Normal View History

2021-01-21 08:41:40 +00:00
package main
import (
"bufio"
"os"
"strings"
)
func readStdin() string {
bs := bufio.NewScanner(os.Stdin)
for bs.Scan() {
line := bs.Text()
line = strings.TrimSpace(line)
if line == "" {
continue
}
return line
}
return ""
}