-
-
Notifications
You must be signed in to change notification settings - Fork 501
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 1.18] Introduce type parameters #2034
Conversation
9e8803f
to
49d56d5
Compare
527656e
to
ca4b9c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing special to say, I'm yet to get used to Generics, but LGTM
bes := make([]V, 0, len(r.backends)) | ||
for _, be := range r.backends { | ||
bes = append(bes, be) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking forward the new maps
package in 1.19 for that :)
if name == "gpg" { | ||
name = "gpgcli" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have a hardcoded "exception" like that here? Wouldn't it be best to change the name on the backend side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, probably. need to clean this up but it's still hardcoded in a bunch of places.
if be, found := r.backends[key]; found { | ||
return be, nil | ||
} | ||
var zero V |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one, I'll remember it when I'll play with Generics too.
This commit replaces some overly complex constructs with type parameters. Fixes gopasspw#2030 RELEASE_NOTES=[ENHANCEMENT] Generics Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
ca4b9c4
to
4e73c17
Compare
This commit replaces some overly complex constructs with type parameters. Fixes gopasspw#2030 RELEASE_NOTES=[ENHANCEMENT] Generics Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
This commit replaces some overly complex constructs with type
parameters.
Fixes #2030
RELEASE_NOTES=[ENHANCEMENT] Generics
Signed-off-by: Dominik Schulz dominik.schulz@gauner.org