license/stdin.go

23 lines
248 B
Go

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 ""
}