Documentation
¶
Index ¶
- Constants
- func Getenv(env []string, name string) string
- func Gopt_App_Main(a interface{ ... })
- func Setenv__0(ret []string, env map[string]string) []string
- func Setenv__1(ret []string, name, val string) []string
- func Setenv__2(ret []string, env []string) []string
- type App
- func (p *App) Capout(doSth func()) (string, error)
- func (p *App) Exec__0(env map[string]string, name string, args ...string) error
- func (p *App) Exec__1(cmdline string) error
- func (p *App) Exec__2(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 ¶
const (
GopPackage = true
)
Variables ¶
This section is empty.
Functions ¶
func Getenv ¶ added in v1.13.9
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__1 ¶ added in v1.13.9
Exec executes a shell command line with $env variables support.
- exec "GOP_GOCMD=tinygo gop run ."
- exec "ls -l $HOME"
func (*App) ExitCode ¶ added in v1.13.9
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(*)
func (*App) Gop_Env ¶ added in v1.13.9
Gop_Env retrieves the value of the environment variable named by the key.
type OS ¶ added in v1.13.9
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{}