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

chore: update to Go 1.20, oapi-gen/v2 and deps #746

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

lzap
Copy link
Member

@lzap lzap commented Nov 7, 2023

Big update since Go 1.20 is live on ubi9, this allows us to unpin oapi-gen and finally upgrade to v2 which drops ton of dependencies because they have broken down the project into subprojects. I had to regenerate all OpenAPI clients too. Finally, updated all tools and deps to test it out.

github.com/twmb/murmur3 v1.1.8 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
Copy link
Member Author

Choose a reason for hiding this comment

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

Many of dependencies dropped because of openapi-gen changes (echo and its subdependencies).

@@ -17,7 +17,7 @@ imports: ## Rearrange imports using `goimports`

.PHONY: lint
lint: ## Run Go language linter `golangci-lint`
GOROOT=$(GOROOT) PATH=$(GOROOT)/bin:${PATH} GOCACHE=$(GOCACHE) $(GOLINT) run
GOROOT=$(GOROOT) PATH=$(GOROOT)/bin:${PATH} GOCACHE=$(GOCACHE) $(GOLINT) run --path-prefix $(shell pwd)
Copy link
Member Author

Choose a reason for hiding this comment

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

This prefix files with absolute patch which makes the output "clickable" in GoLand directly.

@lzap
Copy link
Member Author

lzap commented Nov 7, 2023

So the newer linter is again more strict, bunch of refactoring:

  • It now insist on require.NoError instead of assert.NoError
  • It insist on assert/require.Len when testing for length
  • It insist on using "getters" for protocol buffers for some reason
  • Had to disable one linter which was doing a lot of false positives

Copy link
Member

@ezr-ondrej ezr-ondrej left a comment

Choose a reason for hiding this comment

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

🧡 it ! I love even the code improvements, but being on Go 1.20 and splitting off the oapi-codegen deps is amazing! 👍

@ezr-ondrej ezr-ondrej merged commit 9eed833 into RHEnVision:main Nov 8, 2023
6 checks passed
@lzap lzap deleted the oapi2 branch November 8, 2023 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants