@ -49,6 +49,13 @@ func main() {
flag.Parse()
// Check if there is input from stdin
info, _ := os.Stdin.Stat()
if (info.Mode() & os.ModeCharDevice) != 0 {
flag.Usage()
os.Exit(1)
}
// Read all input from stdin
reader := bufio.NewReader(os.Stdin)
inputBytes, _ := io.ReadAll(reader)
@ -99,6 +99,13 @@ func main() {
// Read input from stdin
input, _ := reader.ReadString('\n')