Documentation
¶
Index ¶
- Constants
- func Getenv(env []string, name string) string
- func Gopt_App_Main(a interface{ ... })
- func Setenv(ret []string, env map[string]string) []string
- func Setenv(ret []string, name, val string) []string
- func Setenv(ret []string, env []string) []string
- type App
- func (p *App) Capout(doSth func()) (string, error)
- func (p *App) Exec(env map[string]string, name string, args ...string) error
- func (p *App) Exec(cmdline string) error
- func (p *App) Exec(name string, args ...string) error
- func (p *App) ExitCode() int
- func (p *App) Gop_Env(key string) string
- func (p *App) Gop_Exec(name string, args ...string) error
- func (p *App) LastErr() error
- func (p *App) Output() string
- type OS
Constants ¶
View Source
const (
GopPackage = true
)
Variables ¶
This section is empty.
Functions ¶
func Getenv ¶
Getenv retrieves the value of the environment variable named by the key. It returns the value, which will be empty if the variable is not present. To distinguish between an empty value and an unset value, use LookupEnv.
func Gopt_App_Main ¶
func Gopt_App_Main(a interface{ initApp() })
Gopt_App_Main is main entry of this classfile.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is project class of this classfile.
func (*App) Exec ¶
Exec executes a shell command line with $env variables support.
- exec "GOP_GOCMD=tinygo gop run ."
- exec "ls -l $HOME"
func (*App) ExitCode ¶
ExitCode returns exit code of last command execution. Bash-scripting exit codes: 1: Catchall for general errors 2: Misuse of shell builtins (according to Bash documentation) 126: Command invoked cannot execute 127: Command not found 128+n: Fatal error signal "n" 254: Unknown error(*)
type OS ¶
type OS interface { // Environ returns a copy of strings representing the environment, // in the form "key=value". Environ() []string // ExpandEnv replaces ${var} or $var in the string according to the values // of the current environment variables. References to undefined // variables are replaced by the empty string. ExpandEnv(s string) string // Getenv retrieves the value of the environment variable named by the key. // It returns the value, which will be empty if the variable is not present. // To distinguish between an empty value and an unset value, use LookupEnv. Getenv(key string) string // Run starts the specified command and waits for it to complete. Run(c *exec.Cmd) error }
var Sys OS = defaultOS{}
Click to show internal directories.
Click to hide internal directories.