goflags

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package goflags parses Go-compatible build flag syntax into typed LLGo configuration. It is shared by command entry points and non-command build drivers; internal/build consumes only the typed result.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyBuildFlags

func ApplyBuildFlags(conf *build.Config, args []string) error

ApplyBuildFlags validates and appends normalized Go build flags, and maps the supported compiler and linker semantics into typed build configuration. Configuration remains unchanged on error.

func ParseFlagFile

func ParseFlagFile(data string) ([]string, error)

ParseFlagFile parses a flags.txt-style file. Blank lines and full-line comments are ignored. A line beginning with a Go flag whose value is itself an argument list is kept intact, so unquoted values such as "-ldflags=-s -w=false" work. Other lines accept shell-style whitespace, quoting, and backslash escaping and may contain multiple flags.

Types

type ParsedLinkFlags

type ParsedLinkFlags struct {
	Options build.LinkOptions
	Ignored []string
	Present bool
}

ParsedLinkFlags contains the Go linker options that LLGo currently handles. Ignored retains the remaining linker arguments so their order is available as support is added incrementally.

func ParseLinkFlags

func ParseLinkFlags(buildFlags []string) (ParsedLinkFlags, error)

ParseLinkFlags extracts the currently supported flags from normalized Go build flags. Repeated -ldflags values are evaluated in command-line order; each applicable value replaces the previous complete argument list.

Jump to

Keyboard shortcuts

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