()
| 218 | } |
| 219 | |
| 220 | func 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. |
no test coverage detected