-
-
Notifications
You must be signed in to change notification settings - Fork 910
Open
Description
Describe the bug
When running air init, the tool prints a warning: [warning] build.bin is deprecated; set build.entrypoint instead, even though this warning is triggered by the default settings produced by defaultConfig() in runner/config.go.
To Reproduce
- Run
air initwith no existing.air.tomlin your repo. - Observe the warning:
[warning] build.bin is deprecated; set build.entrypoint instead. - Inspect the code in
defaultConfig()inrunner/config.go, which setsBin = "./tmp/main"and leavesEntrypointempty by default. - The warning logic in
warnDeprecatedBintriggers whenBinis set andEntrypointis empty.
func defaultConfig() Config {
build := cfgBuild{
Cmd: "go build -o ./tmp/main .",
Bin: "./tmp/main", // <--- Deprecated field is set
Entrypoint: entrypoint{}, // <--- This being empty satisfies the warning condition
// ...
}
// ...
}
func warnDeprecatedBin(cfg *Config) {
if cfg == nil {
return
}
if cfg.Build.Bin == "" || len(cfg.Build.Entrypoint) > 0 {
return
}
fmt.Fprintln(os.Stdout, "[warning] build.bin is deprecated; set build.entrypoint instead")
}Expected behavior
air init should not warn users about deprecated configuration in its default configuration. The tool's own defaults should not violate its own recommended practices.
Desktop:
- OS: macOS 26.3
- Air Version: 1.64.5
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels