github.com/iron-io/functions@v0.0.0-20180820112432-d59d7d1c40b2/fn/commands/images/run_others.go (about)

     1  // +build !windows
     2  
     3  package commands
     4  
     5  import (
     6  	"io"
     7  	"os"
     8  )
     9  
    10  func Stdin() io.Reader {
    11  	stat, err := os.Stdin.Stat()
    12  	if err != nil || (stat.Mode()&os.ModeCharDevice) != 0 {
    13  		return nil
    14  	}
    15  	return os.Stdin
    16  }