protoc-go-inject-tag

Inject custom tags to protobuf golang struct

BSD-2-CLAUSE License

Stars
1.2K
Committers
14

Bot releases are hidden (Show)

protoc-go-inject-tag - v1.4.0: support for removing gotag annotations/comments Latest Release

Published by lrstanley about 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/favadi/protoc-go-inject-tag/compare/v1.3.0...v1.4.0

protoc-go-inject-tag - v1.3.0: trailing comments, @gotags field & more

Published by lrstanley about 3 years ago

Release highlights:

Added support for trailing comments (comments that follow a field, rather than being above the field):

// file: test.proto
syntax = "proto3";

package pb;
option go_package = "/pb";

message IP {
  string Address = 1; // @gotags: valid:"ip"
  string MAC = 2;     // @gotags: validate:"omitempty"
}

New format for specifying a list of tags to be added:

// file: test.proto
syntax = "proto3";

package pb;
option go_package = "/pb";

message IP {
  // @gotags: valid:"ip"
  string Address = 1;

  // Or:
  string MAC = 2; // @gotags: validate:"omitempty"
}

Deprecations

Some previous cli flags and tags have been marked as deprecated. To see more, check out the README.


For a full list of changes, see here.

protoc-go-inject-tag -

Published by favadi over 4 years ago