You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fi, err := os.Stdin.Stat()
if err != nil {
panic(err)
}
if (fi.Mode() & os.ModeNamedPipe) != 0 {
fmt.Println("data is from pipe")
} else {
fmt.Println("data is from terminal")
}