Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal changes to enable a Go workspace #19423

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ function bom_pass {
run cp go.sum go.sum.tmp || return 2
run cp go.mod go.mod.tmp || return 2

output=$(GOFLAGS=-mod=mod run_go_tool github.com/appscodelabs/license-bill-of-materials \
output=$(run_go_tool github.com/appscodelabs/license-bill-of-materials \
--override-file ./bill-of-materials.override.json \
"${modules[@]}")
code="$?"
Expand Down
2 changes: 1 addition & 1 deletion scripts/updatebom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function bom_fixlet {
# shellcheck disable=SC2207
modules=($(modules_for_bom))

if GOFLAGS=-mod=mod run_go_tool "github.com/appscodelabs/license-bill-of-materials" \
Copy link
Member

Choose a reason for hiding this comment

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

GOFLAGS=-mod=mod is this even a correct flag? Could we remove it regardless of workspace migration?

Copy link
Member Author

@ivanvc ivanvc Feb 22, 2025

Choose a reason for hiding this comment

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

Yes, I think so. This should predate Go 1.1113.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, never mind. Actually, I believe, due to the note in bom_pass, we may need to leave the -mod=mod flag in the tests. But you're right. There's no need for it to be here, as test_lib.sh doesn't define a GOFLAGS=-mod that we need to override. I'll open a pull request for this change.

if run_go_tool "github.com/appscodelabs/license-bill-of-materials" \
--override-file ./bill-of-materials.override.json \
"${modules[@]}" > ./bill-of-materials.json.tmp; then
cp ./bill-of-materials.json.tmp ./bill-of-materials.json
Expand Down