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

Adjust ToStringKey use unpack params, fix pass []any as any in variadic function #5500

Merged
merged 2 commits into from
Jul 14, 2022

Conversation

alingse
Copy link
Contributor

@alingse alingse commented Jul 9, 2022

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

i am writing a linter to lint my silly bug in work.
and run github Actions for some top go packages, gorm failed here

Error: /home/runner/work/asasalint/asasalint/gorm/callbacks/associations.go:209:38: pass []any as any to func ToStringKey func(values ...interface{}) string
Error: /home/runner/work/asasalint/asasalint/gorm/callbacks/associations.go:29[5](https://github.com/alingse/asasalint/runs/7263106786?check_suite_focus=true#step:7:6):38: pass []any as any to func ToStringKey func(values ...interface{}) string
Error: /home/runner/work/asasalint/asasalint/gorm/migrator/migrator.go:201:29: pass []any as any to func append func([]interface{}, ...interface{}) []interface{}

these three is not bug (migrator/migrator.go:201 is by desgin)

ToStringKey's current usage worked, but change to use unpacked params might be better.

User Case Description

@jinzhu jinzhu merged commit 099813b into go-gorm:master Jul 14, 2022
jinzhu pushed a commit that referenced this pull request Sep 22, 2022
…ic function (#5500)

* fix pass []any as any in variadic function

* add .vscode to gitignore
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.

3 participants