build

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package build is the build flag logic shared across mage and the CLI

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GCFLags

func GCFLags() string

GCFLags will return the gc flags needed to build this binary.

Only -l (disable inlining) is set, and it is set for its size effect: inlining copies a function body to every call site, which across this repo's dependency tree costs far more space than it buys a CLI that is not CPU-bound.

Two flags that used to be here were removed deliberately, see docs/dev/build-flags.md:

  • -B (disable bounds checking) bought about 1% of binary size in exchange for removing bounds checks from every package in the tree, including the code that parses untrusted archives and registry responses. That is where a bounds check is what turns a malformed length field into a panic rather than an out-of-bounds read.
  • -C does nothing for size. `go tool compile -help` documents it as "disable printing of columns in error messages" -- a diagnostic formatting flag with no effect on generated code.

func LDFlags

func LDFlags(version string, commit string) string

LDFlags will return the ld flags needed to build this binary

Types

This section is empty.

Jump to

Keyboard shortcuts

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