MCPcopy
hub / github.com/perkeep/perkeep / goEnv

Function goEnv

make.go:220–239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

218}
219
220func goEnv() (ret []string) {
221 ret = slices.Clone(os.Environ())
222 var cross bool
223 if *buildOS != runtime.GOOS {
224 ret = append(ret, envPair("GOOS", *buildOS))
225 cross = true
226 }
227 if *buildARCH != runtime.GOARCH {
228 ret = append(ret, envPair("GOARCH", *buildARCH))
229 cross = true
230 }
231 if cross {
232 ret = append(ret, envPair("GOBIN", ""))
233 }
234 // If we're building for ARM (regardless of cross-compiling or not), we reset GOARM
235 if *buildARCH == "arm" {
236 ret = append(ret, envPair("GOARM", *buildARM))
237 }
238 return ret
239}
240
241// fullSrcPath returns the full path concatenation
242// of pkRoot with fromSrc.

Callers 2

mainFunction · 0.85
actualBinDirFunction · 0.85

Calls 2

envPairFunction · 0.85
CloneMethod · 0.80

Tested by

no test coverage detected