Skip to content

Commit

Permalink
add golang.WithCompiler() to set compiler on existing env
Browse files Browse the repository at this point in the history
Signed-off-by: Roger Standridge <[email protected]>
  • Loading branch information
archie2x committed Aug 9, 2024
1 parent b37fc01 commit ee82c9a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pkg/golang/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ func WithWorkingDir(wd string) Opt {
}
}

// WithCompiler sets the compiler for Build() / BuildDir()
func WithCompiler(p string) Opt {
return func(c *Environ) {
c.Compiler.Path = p
}
}

// Default is the default build environment comprised of the default GOPATH,
// GOROOT, GOOS, GOARCH, and CGO_ENABLED values.
func Default(opts ...Opt) *Environ {
Expand Down

0 comments on commit ee82c9a

Please sign in to comment.