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: replace direct 'go' command with '$(GO)' variable #702

Merged
merged 3 commits into from
Jan 4, 2025

Conversation

elliotxx
Copy link
Collaborator

@elliotxx elliotxx commented Jan 3, 2025

What type of PR is this?

/kind chore

What this PR does / why we need it:

This PR replaces direct usage of the 'go' command with the '$(GO)' variable in the Makefile and go.mk files.

Key changes include:

  • Updated build, test, lint, and other Go-related commands to use '$(GO)' instead of 'go'.
    Usage (modify go.mk#L5):
# Define GO command with a default value that can be overridden. e.g. GO ?= go1.22.6
GO ?= go1.22.6
  • This change simplifies Go version management and ensures consistency across different environments.
  • It provides greater flexibility for managing Go versions in various development and CI/CD setups.
  • Bump the github.com/bytedance/mockey from v1.2.10 to v1.2.13, fix error link: github.com/bytedance/mockey/internal/monkey/common: invalid reference to runtime.sysAllocOS

Which issue(s) this PR fixes:

Fixes #697

- Update Makefile and go.mk to use '$(GO)' instead of 'go'
- This change allows for easier Go version management and flexibility
- Affects build, test, lint, and other Go-related commands

Using a variable for the Go command simplifies version management and ensures consistency across different environments.
@elliotxx elliotxx added this to the v0.6.0 milestone Jan 3, 2025
@elliotxx elliotxx self-assigned this Jan 3, 2025
@elliotxx elliotxx changed the title refactor: replace direct 'go' command with '$(GO)' variable chore: replace direct 'go' command with '$(GO)' variable Jan 3, 2025
- Update github.com/bytedance/mockey to v1.2.13
- Update github.com/gopherjs/gopherjs to v1.17.2
- Update github.com/smartystreets/assertions to v1.16.0
- Update github.com/smartystreets/goconvey to v1.8.1
- Update golang.org/x/arch to v0.12.0
- Update golang.org/x/sys to v0.28.0

These updates ensure compatibility and security improvements.

test: ensure proper cleanup of mocks in certgenerator tests

- Add `mockey.UnPatchAll()` at the start of each test case
- Ensure mocks are properly cleaned up after each test

This change prevents mock interference between test cases, improving test reliability.
- Add 'github.com/swaggo/http-swagger/v2' and 'golang.org/x/sync' as direct dependencies
- Remove 'github.com/swaggo/http-swagger/v2' from indirect dependencies
- Correct a typo in the 'golang.org/x/tools' comment

These changes ensure the project uses the latest versions of necessary libraries and corrects a minor documentation error.
Copy link
Collaborator

@ruquanzhao ruquanzhao left a comment

Choose a reason for hiding this comment

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

/lgtm

@ruquanzhao ruquanzhao merged commit 3d5c6df into main Jan 4, 2025
9 checks passed
@ruquanzhao ruquanzhao deleted the support-go-alias-in-makefile branch January 4, 2025 02:33
@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Makefile does not pick up go alias: consider introducing a variable
2 participants