build: ensure GOBIN directory exists before use

This commit is contained in:
Aofei Sheng
2024-07-08 08:56:19 +08:00
parent 5de5a8ca94
commit a1cb2a0589

View File

@@ -79,6 +79,9 @@ func NewDefaultConf(mode Mode) *Config {
}
bin = filepath.Join(gopath, "bin")
}
if err := os.MkdirAll(bin, 0755); err != nil {
panic(fmt.Errorf("cannot create bin directory: %v", err))
}
conf := &Config{
BinPath: bin,
Mode: mode,