Help us shape the future of Go! Take the 2026 Go Developer Survey

flags

package
v2.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Quiet   int = 0
	Normal  int = 1
	Verbose int = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	Common
	BuildCommon

	NoPackage               bool   `description:"Skips platform specific packaging"`
	Upx                     bool   `description:"Compress final binary with UPX (if installed)"`
	UpxFlags                string `description:"Flags to pass to upx"`
	Platform                string `description:"Platform to target. Comma separate multiple platforms"`
	OutputFilename          string `name:"o" description:"Output filename"`
	Clean                   bool   `description:"Clean the bin directory before building"`
	WebView2                string `description:"WebView2 installer strategy: download,embed,browser,error"`
	ForceBuild              bool   `name:"f" description:"Force build of application"`
	UpdateWailsVersionGoMod bool   `name:"u" description:"Updates go.mod to use the same Wails version as the CLI"`
	Debug                   bool   `description:"Builds the application in debug mode"`
	Devtools                bool   `description:"Enable Devtools in productions, Already enabled in debug mode (-debug)"`
	NSIS                    bool   `description:"Generate NSIS installer for Windows"`
	InstallScope            string `description:"NSIS install scope: machine (default) or user"`
	TrimPath                bool   `description:"Remove all file system paths from the resulting executable"`
	WindowsConsole          bool   `description:"Keep the console when building for Windows"`
	Obfuscated              bool   `description:"Code obfuscation of bound Wails methods"`
	GarbleArgs              string `description:"Arguments to pass to garble"`
	DryRun                  bool   `description:"Prints the build command without executing it"`
	// contains filtered or unexported fields
}

TODO: unify this and `build.Options`

func (*Build) Default

func (b *Build) Default() *Build

func (*Build) GetBuildMode

func (b *Build) GetBuildMode() build.Mode

func (*Build) GetBuildModeAsString

func (b *Build) GetBuildModeAsString() string

func (*Build) GetCompilerPath

func (b *Build) GetCompilerPath() string

func (*Build) GetDefaultArch

func (b *Build) GetDefaultArch() string

func (*Build) GetTags

func (b *Build) GetTags() []string

func (*Build) GetTargets

func (b *Build) GetTargets() *slicer.StringSlicer

func (*Build) GetWebView2Strategy

func (b *Build) GetWebView2Strategy() string

func (*Build) Process

func (b *Build) Process() error

type BuildCommon

type BuildCommon struct {
	LdFlags         string `description:"Additional ldflags to pass to the compiler"`
	Compiler        string `description:"Use a different go compiler to build, eg go1.15beta1"`
	SkipBindings    bool   `description:"Skips generation of bindings"`
	RaceDetector    bool   `name:"race" description:"Build with Go's race detector"`
	SkipFrontend    bool   `name:"s" description:"Skips building the frontend"`
	Verbosity       int    `name:"v" description:"Verbosity level (0 = quiet, 1 = normal, 2 = verbose)"`
	Tags            string `description:"Build tags to pass to Go compiler. Must be quoted. Space or comma (but not both) separated"`
	NoSyncGoMod     bool   `description:"Don't sync go.mod"`
	SkipModTidy     bool   `name:"m" description:"Skip mod tidy before compile"`
	SkipEmbedCreate bool   `description:"Skips creation of embed files"`
}

func (BuildCommon) Default

func (c BuildCommon) Default() BuildCommon

type Common

type Common struct {
	NoColour bool `description:"Disable colour in output"`
}

type Dev

type Dev struct {
	BuildCommon

	AssetDir             string `flag:"assetdir" description:"Serve assets from the given directory instead of using the provided asset FS"`
	Extensions           string `flag:"e" description:"Extensions to trigger rebuilds (comma separated) eg go"`
	ReloadDirs           string `flag:"reloaddirs" description:"Additional directories to trigger reloads (comma separated)"`
	Browser              bool   `flag:"browser" description:"Open the application in a browser"`
	NoReload             bool   `flag:"noreload" description:"Disable reload on asset change"`
	NoColour             bool   `flag:"nocolor" description:"Disable colour in output"`
	NoGoRebuild          bool   `flag:"nogorebuild" description:"Disable automatic rebuilding on backend file changes/additions"`
	WailsJSDir           string `flag:"wailsjsdir" description:"Directory to generate the Wails JS modules"`
	LogLevel             string `flag:"loglevel" description:"LogLevel to use - Trace, Debug, Info, Warning, Error)"`
	ForceBuild           bool   `flag:"f" description:"Force build of application"`
	Debounce             int    `flag:"debounce" description:"The amount of time to wait to trigger a reload on change"`
	DevServer            string `flag:"devserver" description:"The address of the wails dev server"`
	AppArgs              string `flag:"appargs" description:"arguments to pass to the underlying app (quoted and space separated)"`
	Save                 bool   `flag:"save" description:"Save the given flags as defaults"`
	FrontendDevServerURL string `flag:"frontenddevserverurl" description:"The url of the external frontend dev server to use"`
	ViteServerTimeout    int    `flag:"viteservertimeout" description:"The timeout in seconds for Vite server detection (default: 10)"`
	// contains filtered or unexported fields
}

func (*Dev) Default

func (*Dev) Default() *Dev

func (*Dev) DevServerURL

func (d *Dev) DevServerURL() *url.URL

func (*Dev) GenerateBuildOptions

func (d *Dev) GenerateBuildOptions() *build.Options

GenerateBuildOptions creates a build.Options using the flags

func (*Dev) Process

func (d *Dev) Process() error

func (*Dev) ProjectConfig

func (d *Dev) ProjectConfig() *project.Project

type Doctor

type Doctor struct {
	Common
}

func (*Doctor) Default

func (b *Doctor) Default() *Doctor

type GenerateModule

type GenerateModule struct {
	Common
	Compiler  string `description:"Use a different go compiler to build, eg go1.15beta1"`
	Tags      string `description:"Build tags to pass to Go compiler. Must be quoted. Space or comma (but not both) separated"`
	Verbosity int    `name:"v" description:"Verbosity level (0 = quiet, 1 = normal, 2 = verbose)"`
}

func (*GenerateModule) Default added in v2.8.0

func (c *GenerateModule) Default() *GenerateModule

type GenerateTemplate

type GenerateTemplate struct {
	Common
	Name     string `description:"Name of the template to generate"`
	Frontend string `description:"Frontend to use for the template"`
	Quiet    bool   `description:"Suppress output"`
}

type Init

type Init struct {
	Common

	TemplateName string `name:"t" description:"Name of built-in template to use, path to template or template url"`
	ProjectName  string `name:"n" description:"Name of project"`
	CIMode       bool   `name:"ci" description:"CI Mode"`
	ProjectDir   string `name:"d" description:"Project directory"`
	Quiet        bool   `name:"q" description:"Suppress output to console"`
	InitGit      bool   `name:"g" description:"Initialise git repository"`
	IDE          string `name:"ide" description:"Generate IDE project files"`
	List         bool   `name:"l" description:"List templates"`
}

func (*Init) Default

func (i *Init) Default() *Init

type ShowReleaseNotes

type ShowReleaseNotes struct {
	Common
	Version string `description:"The version to show the release notes for"`
}

type Update

type Update struct {
	Common
	Version    string `description:"The version to update to"`
	PreRelease bool   `name:"pre" description:"Update to latest pre-release"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL