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

runtime

package
v0.239.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddProjectFlag added in v0.239.0

func AddProjectFlag(cmd *cobra.Command)

AddProjectFlag registers the --project flag that flips a write command from the userspace baseline (~/.infer/) to the project .infer/ override layer.

func ConfigPath added in v0.239.0

func ConfigPath(toProject bool, name string) (string, error)

ConfigPath resolves name under the project .infer/ override when toProject is set, and under the userspace baseline (~/.infer/) otherwise.

func ConfigWriteTarget

func ConfigWriteTarget(toProject bool) (*viper.Viper, string, error)

ConfigWriteTarget returns a fresh Viper instance for a userspace baseline or sparse project override without writing the fully merged runtime config.

func FileExists

func FileExists(path string) bool

func ParseDelimitedList added in v0.239.0

func ParseDelimitedList(value string) []string

ParseDelimitedList parses a comma/newline-separated value into a string slice, dropping empty items - the split rule shared by the INFER_* list environment overrides and `config set` list values.

func ProjectFlag

func ProjectFlag(cmd *cobra.Command) bool

ProjectFlag checks for the --project flag on the current command or any parent command. Userspace-first model: config writes target the home ~/.infer/ baseline by default; --project opts into a project override.

func SidecarFile added in v0.236.2

func SidecarFile(key string) (string, bool)

SidecarFile returns the split file a dotted config key lives in, and false for a key that belongs to config.yaml.

func UserConfigPath added in v0.239.0

func UserConfigPath(name string) (string, error)

UserConfigPath resolves name under the userspace baseline (~/.infer/).

Types

type State

type State struct {
	// contains filtered or unexported fields
}

State owns configuration and logging initialized for one Cobra command tree. Cobra executes initialization before RunE, so no synchronization is needed.

func NewState

func NewState() *State

func (*State) Config

func (s *State) Config() *config.Config

func (*State) ConfigureDaemonLogging

func (s *State) ConfigureDaemonLogging()

func (*State) DisableStdoutLogging

func (s *State) DisableStdoutLogging()

func (*State) Initialize

func (s *State) Initialize(root *cobra.Command) error

func (*State) LoadConfig added in v0.223.0

func (s *State) LoadConfig() (*config.Config, error)

LoadConfig re-runs the startup load (defaults, config.yaml layers, sidecar files, INFER_* env) and returns a fresh validated config. It leaves the running config and logging alone, so the caller decides what to apply.

func (*State) Viper

func (s *State) Viper() *viper.Viper

Jump to

Keyboard shortcuts

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