Skip to content

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