Comments (2)
This still does not fix required support.
from proto.
do you mean this case?
func TestRequiredGroupInMessage(t *testing.T) {
src := `message SearchResponse {
required group Result = 1 {
string url = 2;
}
}`
p := newParserOn(src)
p.next() // consume first token
m := new(Message)
err := m.parse(p)
if err != nil {
t.Error(err)
}
if got, want := len(m.Elements), 1; got != want {
t.Logf("%#v", m.Elements)
t.Fatalf("got [%v] want [%v]", got, want)
}
g := m.Elements[0].(*Group)
if got, want := len(g.Elements), 1; got != want {
t.Fatalf("got [%v] want [%v]", got, want)
}
if got, want := g.Repeated, false; got != want {
t.Fatalf("got Repeated [%v] want [%v]", got, want)
}
if got, want := !g.Optional, true; got != want {
t.Fatalf("got Required [%v] want [%v]", got, want)
}
}
from proto.
Related Issues (20)
- Unable to parse simple protobuf file with imported options HOT 12
- Package name with "." causes issues when parsing HOT 1
- Issue with double-quoted options HOT 1
- Quote dropped in option parsing
- Missing semicolon at end silently ignored. HOT 1
- Quoted string constant
- Multi-line fields not parseable
- QuoteRune is a breaking change HOT 4
- Write proto struct to file? HOT 1
- Comments inside field options break parser HOT 2
- Nested enum with inline comments break parser HOT 5
- Infinite loop in Parser.Parse() HOT 2
- Sir, if I get the package field? HOT 3
- support proto3 presence HOT 1
- Field type with keyword is not correctly parsed HOT 3
- Option string values parsed as numbers HOT 8
- embedded comment parse fail HOT 7
- Parse failure on negative reserved enums HOT 4
- Boolean variable to test if a field is deprecated HOT 11
- Parsing comments inside an array in an Option HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proto.