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

go fmt with Go 1.17 #396

Merged
merged 4 commits into from
Sep 2, 2021
Merged

go fmt with Go 1.17 #396

merged 4 commits into from
Sep 2, 2021

Conversation

Didainius
Copy link
Collaborator

@Didainius Didainius commented Sep 1, 2021

Go 1.17 introduced changes to how build tags are defined. gofmt automatically fixes that and this PR is just to make sure we are 1.17 compatible so that make build works.

Additionally it tunes sed command in test-tags.sh so that it gathers all tags and ignores or || sign in new build tag format.

A longer description.
Go 1.17 started to use new format of build tags (which we use to separate test cases). In Go 1.17 go fmt command automatically maintains two types of build tags - new and old one. That way the code is still compatible with older Go versions. go fmt (in Go 1.17) will also keep these build directives in sync (older format with newer one). Additionally go vet will capture if these tags are not in sync. Our GitHub workflow will run on Go 1.17 now and it will capture if any of submitted tags are not in sync.

Example of how new build directive looks (line1) and older one (line2)

//go:build api || functional || catalog || vapp || network || extnetwork || org || query || vm || vdc || gateway || disk || binary || lb || lbServiceMonitor || lbServerPool || lbAppProfile || lbAppRule || lbVirtualServer || access_control || user || standaloneVm || search || auth || nsxt || role || ALL
// +build api functional catalog vapp network extnetwork org query vm vdc gateway disk binary lb lbServiceMonitor lbServerPool lbAppProfile lbAppRule lbVirtualServer access_control user standaloneVm search auth nsxt role ALL

Signed-off-by: Dainius Serplis <dserplis@vmware.com>
@Didainius Didainius self-assigned this Sep 1, 2021
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
@Didainius Didainius merged commit 01b2289 into vmware:master Sep 2, 2021
@Didainius Didainius deleted the 1_17 branch September 2, 2021 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants