"cmd/go/internal/cfg"
"cmd/go/internal/fsys"
"cmd/go/internal/modload"
- "cmd/internal/objabi"
"cmd/internal/sys"
"flag"
"fmt"
"os"
"path/filepath"
"runtime"
- "strings"
)
func BuildInit() {
modload.Init()
instrumentInit()
buildModeInit()
- if err := fsys.Init(base.Cwd); err != nil {
+ if err := fsys.Init(base.Cwd()); err != nil {
base.Fatalf("go: %v", err)
}
base.Fatalf("go %s: %s environment variable is relative; must be absolute path: %s\n", flag.Args()[0], key, path)
}
}
-
- // For each experiment that has been enabled in the toolchain, define a
- // build tag with the same name but prefixed by "goexperiment." which can be
- // used for compiling alternative files for the experiment. This allows
- // changes for the experiment, like extra struct fields in the runtime,
- // without affecting the base non-experiment code at all. [2:] strips the
- // leading "X:" from objabi.Expstring().
- exp := objabi.Expstring()[2:]
- if exp != "none" {
- experiments := strings.Split(exp, ",")
- for _, expt := range experiments {
- cfg.BuildContext.BuildTags = append(cfg.BuildContext.BuildTags, "goexperiment."+expt)
- }
- }
}
func FuzzInstrumentFlags() []string {