You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

16 lines
205 B

  1. package main
  2. import (
  3. "fmt"
  4. "github.com/mattn/go-isatty"
  5. "os"
  6. )
  7. func main() {
  8. if isatty.IsTerminal(int(os.Stdout.Fd())) {
  9. fmt.Println("Is Terminal")
  10. } else {
  11. fmt.Println("Is Not Terminal")
  12. }
  13. }