diff --git a/cmd/cue/cmd/help.go b/cmd/cue/cmd/help.go index f9138de0639..88b699c5115 100644 --- a/cmd/cue/cmd/help.go +++ b/cmd/cue/cmd/help.go @@ -351,6 +351,13 @@ The following variables are supported: freebsd illumos ios js (wasm) linux netbsd openbsd plan9 solaris windows + arch architecture identifier of the current system. Valid values: + 386 amd64 amd64p32 arm + armbe arm64 arm64be loong64 + mips mipsle mips64 mips64le + mips64p32 mips64p32le ppc ppc64 + ppc64le riscv riscv64 s390 + s390x sparc sparc64 wasm cwd working directory username current username hostname current hostname diff --git a/cue/load/tags.go b/cue/load/tags.go index 7e54a8d86e5..1f399ab5bbc 100644 --- a/cue/load/tags.go +++ b/cue/load/tags.go @@ -72,6 +72,11 @@ func DefaultTagVars() map[string]TagVar { return ast.NewString(runtime.GOOS), nil }, }, + "arch": { + Func: func() (ast.Expr, error) { + return ast.NewString(runtime.GOARCH), nil + }, + }, "cwd": { Func: func() (ast.Expr, error) { return varToString(os.Getwd())