func Compiled() bool
Compiled returns a boolean which tells if you run a already compiled binary or "go run" the source.
func Compiler() string
Compiler returns the name of the used compiler
func Dir() string
Dir returns the directory in which the binary or source file is stored. This is useful if you have config files in the same folder.
func GOARCH() string
GOARCH returns the system architecture
func GOOS() string
GOOS returns the name of the Operating System
func GOPATH() string
GOPATH returns the $GOPATH environment variable
func GOROOT() string
GOROOT returns the $GOROOT environment variable
func Name() string
Name returns the filename of the binary or source file which is currently running.
func Path() string
Path returns the full path of the binary or source file which is currently running.
func WD() string
WD returns the working directory, this is the folder where you were last.
type FileType int
const ( DontExist FileType = iota Directory ASCII Binary )
func GetFileType(name string) FileType
GetFileType returns the type of a given file. The return values can be Directory, ASCII, Binary or DontExist.