Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

[Tooling] Remove use of -compat flag for go mod #3570

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

marckhouzam
Copy link
Contributor

@marckhouzam marckhouzam commented Oct 6, 2022

What this PR does / why we need it

Stop using the go mod -compat flag which was only useful when using Go 1.17.

When we were using go 1.17, we decided to use the -compat=1.17 flag of go mod so as to use the pruned Go module graph introduced by Go 1.17. Details can be found in this Stack Overflow answer and in the Go documentation.

Now that we are running Go 1.18 thanks to #3577, go mod will build the dependency graph for go 1.18 and 1.17, which both use the pruned graph.

We therefore don't need to use the -compat=1.17 flag anymore.

Which issue(s) this PR fixes

Fixes #3569

Describe testing done for PR

Make sure to be running Go 1.18.
Apply this PR and run make modules and see that no files are changed.

@marckhouzam marckhouzam requested a review from a team as a code owner October 6, 2022 12:56
@marckhouzam marckhouzam requested a review from anujc25 October 6, 2022 12:56
@randomvariable randomvariable added the ok-to-merge PRs should be labelled with this before merging label Oct 6, 2022
@randomvariable randomvariable changed the title Remove use of -compat flag for go mod [Tooling] Remove use of -compat flag for go mod Oct 6, 2022
@marckhouzam
Copy link
Contributor Author

We're going to hold on this as the change to Go 1.18 may be reverted by #3571

@marckhouzam marckhouzam added the do-not-merge/hold Some fixes necessary, hold for merging label Oct 6, 2022
Copy link
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@vuil vuil assigned marckhouzam and unassigned marckhouzam Oct 7, 2022
Fixes vmware-tanzu#3569

Now that we use go.18 for all our modules, the -compat flag is no
longer useful.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
@marckhouzam marckhouzam removed the do-not-merge/hold Some fixes necessary, hold for merging label Oct 12, 2022
@marckhouzam
Copy link
Contributor Author

Now that #3577 has been merged, we should go ahead and do this cleanup.

@codecov
Copy link

codecov bot commented Oct 12, 2022

Codecov Report

Merging #3570 (6ef7f9c) into main (83f9375) will decrease coverage by 0.87%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #3570      +/-   ##
==========================================
- Coverage   46.31%   45.44%   -0.88%     
==========================================
  Files         400      425      +25     
  Lines       39583    41147    +1564     
==========================================
+ Hits        18334    18698     +364     
- Misses      19563    20747    +1184     
- Partials     1686     1702      +16     
Impacted Files Coverage Δ
cmd/cli/plugin/cluster/machinehealthcheck.go 100.00% <0.00%> (ø)
cmd/cli/plugin/cluster/kubeconfig_get.go 8.82% <0.00%> (ø)
...in/cluster/set_machinehealthcheck_control_plane.go 21.21% <0.00%> (ø)
...i/plugin/cluster/delete_machinehealthcheck_node.go 16.66% <0.00%> (ø)
cmd/cli/plugin/cluster/credentials_update.go 9.23% <0.00%> (ø)
...in/cluster/get_machinehealthcheck_control_plane.go 11.11% <0.00%> (ø)
cmd/cli/plugin/cluster/main.go 0.00% <0.00%> (ø)
cmd/cli/plugin/cluster/scale.go 17.85% <0.00%> (ø)
.../cli/plugin/cluster/get_machinehealthcheck_node.go 9.30% <0.00%> (ø)
.../cli/plugin/cluster/set_machinehealthcheck_node.go 23.33% <0.00%> (ø)
... and 16 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@marckhouzam marckhouzam merged commit 59b5a1d into vmware-tanzu:main Oct 12, 2022
@marckhouzam marckhouzam deleted the fix/cleanupCompat branch October 12, 2022 14:10
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
CI cla-not-required ok-to-merge PRs should be labelled with this before merging priority/critical-urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup: stop using "-compat" flag for go mod
5 participants