Documentation
¶
Index ¶
- Constants
- func Getenv(env []string, name string) string
- func InitApp(app *App)
- 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
- func XGot_App_Main(a interface{ ... })
- 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) LastErr() error
- func (p *App) Output() string
- func (p *App) XGo_Env(key string) string
- func (p *App) XGo_Exec(name string, args ...string) error
- type OS
Constants ¶
const (
XGoPackage = 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 InitApp ¶ added in v1.15.2
func InitApp(app *App)
InitApp initializes an App instance. It is provided so that an App instance embedded in a struct can be initialized from another package.
func XGot_App_Main ¶ added in v1.16.0
func XGot_App_Main(a interface{ initApp() })
XGot_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 "XGO_GOCMD=tinygo xgo 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(*)
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{}