Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/package-managers/go/src/main/kotlin/GoMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ class GoMod(
val cleanGoPath = createOrtTempDir()
put("GOPATH", cleanGoPath.absolutePath)
put("GOPROXY", "direct")
} else if (!config.disableGoProxy && System.getenv("GOPROXY") != null) {
put("GOPROXY", System.getenv("GOPROXY"))
Comment on lines +107 to +108
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments here:

  • The !config.disableGoProxy && part is not necessary.
  • While I get what you try to do here, the original intent of disableGoProxy was really do disable the Go proxy.

Let me think about this a bit and make a proposal for improvement.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked the code again, and I believe your changes should not be necessary. The code at

GoCommand.run(*args, workingDir = projectDir, environment = goEnvironment).requireSuccess()

only specified additional environment variables use, on top of those available to the environment running ORT. So any set GOPROXY variable would get inherited.

Can you confirm that this is the case, @losmateusz1?

Anyway, I agree that the current option name is misleading, as it does not completely disable any set GOPROXY. I'm clarifying that in #11189.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sschuberth we can close this PR, I checked again with latest ort code and I can't reproduce the issue anymore

}
}

Expand Down