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

Add convenience accessor functions on metadata #35

Open
robsignorelli opened this issue Feb 22, 2021 · 0 comments
Open

Add convenience accessor functions on metadata #35

robsignorelli opened this issue Feb 22, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@robsignorelli
Copy link
Collaborator

When you have more than one value to grab from metadata, it can be fairly inconvenient to do this:

var someString string
var someInt int
metadata.Value(ctx, "foo", &someString)
metadata.Value(ctx, "bar", &someInt)

It would be nice if we could do something like this which feels more natural.

someString := metadata.Stringctx, "foo")
someInt := metadata.Int(ctx, "bar")

When generics land, maybe we can even do something like:

someStruct := metadata.Value(ctx, "bar", &MyStructType{})

But for now convenience functions for basic types will go a long way.

@robsignorelli robsignorelli added enhancement New feature or request good first issue Good for newcomers labels Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant