protocolbuffers.github.io icon indicating copy to clipboard operation
protocolbuffers.github.io copied to clipboard

Fix protobuf examples at editions/overview.md

Open SpringMT opened this issue 1 year ago • 1 comments

Lexical Scoping protobuf examples is invalid.

$ cat person.proto
edition = "2023";

option features.enum_type = CLOSED;

message Person {
  string name = 1;
  int32 id = 2 [features.presence = IMPLICIT];

  enum Pay_Type {
    PAY_TYPE_UNSPECIFIED = 1,
    PAY_TYPE_SALARY = 2,
    PAY_TYPE_HOURLY = 3
  }

  enum Employment {
    option features.enum_type = OPEN;
    EMPLOYMENT_UNSPECIFIED = 0,
    EMPLOYMENT_FULLTIME = 1,
    EMPLOYMENT_PARTTIME = 2,
  }
  Employment employment = 4;
}

$ protoc --go_out=./my_proto --go_opt=paths=source_relative person.proto
person.proto:10:29: Expected ";".
person.proto:17:31: Expected ";".

In this PR, fix using valid protobuf.

SpringMT avatar May 15 '24 00:05 SpringMT

Thanks for sending this PR to fix the syntax problems. I'll work on getting this incorporated.

Logofile avatar May 17 '24 20:05 Logofile

This fix was incorporated in this PR that bundled various updates. Thanks for sending the update!

Logofile avatar Jun 28 '24 13:06 Logofile