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 plugin annotation #688

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add plugin annotation #688

wants to merge 1 commit into from

Conversation

u2takey
Copy link

@u2takey u2takey commented May 17, 2020

this is a proposal and implementation for a new plugin annotation, which add an string annotation for message type, which can be used like JAVA's runtime annotation.

Usage:

message X {
    option (gogoproto.annotation) = 'a string';
}

message Y {
    // annotation could be a json string
    option (gogoproto.annotation) = '{"A":"a"}';
}

Retrieve

import (
    gogoproto "github.com/gogo/protobuf/proto"
)

fmt.Println(gogoproto.GetAnnotations())
fmt.Println(gogoproto.GetAnnotation(&proto.X{}))

…ype, which can be used like JAVA's runtime annotation.
@u2takey
Copy link
Author

u2takey commented May 18, 2020

@awalterschulze @jmarais

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.

1 participant