Only include builtin by default when no packages are supplied

master
FractalU 2023-06-11 15:14:34 +02:00
parent cc6c933552
commit c58e40c51d
1 changed files with 10 additions and 11 deletions

21
main.go
View File

@ -295,19 +295,18 @@ func run() error {
}
pkgs = strings.Split(strings.TrimSpace(buf.String()), "\n")
}
// Always include the 'builtin' package as well, if not already present.
// It's to ensure that the links to types such as string, int, bool, any, etc. are accessible.
hasBuiltin := false
for _, pkg := range pkgs {
if pkg == "builtin" {
hasBuiltin = true
break
// Include the 'builtin' package as well, if not already present.
hasBuiltin := false
for _, pkg := range pkgs {
if pkg == "builtin" {
hasBuiltin = true
break
}
}
if !hasBuiltin {
pkgs = append(pkgs, "builtin")
}
}
if !hasBuiltin {
pkgs = append(pkgs, "builtin")
}
var newPkgs []string