Skip to content

Commit

Permalink
updated to protoc 3.1.0 and fixed casttype string populate
Browse files Browse the repository at this point in the history
  • Loading branch information
awalterschulze committed Oct 27, 2016
1 parent 91cc249 commit a9cd0c3
Show file tree
Hide file tree
Showing 96 changed files with 21,207 additions and 20,914 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
env:
- PROTOBUF_VERSION=2.5.0
- PROTOBUF_VERSION=2.6.1
- PROTOBUF_VERSION=3.0.2
- PROTOBUF_VERSION=3.1.0

before_install:
- ./install-protobuf.sh
Expand All @@ -10,7 +10,7 @@ before_install:
script:
- PATH=/home/travis/bin:$PATH make buildserverall
- echo $TRAVIS_GO_VERSION
- if [ "$TRAVIS_GO_VERSION" == 1.7.1 ] && [[ "$PROTOBUF_VERSION" == 3.0.2 ]]; then ! git status --porcelain | read || (git status; git diff; exit 1); fi
- if [ "$TRAVIS_GO_VERSION" == 1.7.1 ] && [[ "$PROTOBUF_VERSION" == 3.1.0 ]]; then ! git status --porcelain | read || (git status; git diff; exit 1); fi

language: go

Expand Down
349 changes: 175 additions & 174 deletions _conformance/conformance_proto/conformance.pb.go

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions jsonpb/jsonpb_test_proto/test_objects.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion plugin/populate/populate.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ func (p *plugin) GenerateField(file *generator.FileDescriptor, message *generato
p.P(`}`)
}
} else if field.IsString() {
val := fmt.Sprintf("randString%v(r)", p.localName)
typName := generator.GoTypeToName(goTyp)
val := fmt.Sprintf("%s(randString%v(r))", typName, p.localName)
if field.IsRepeated() {
p.P(p.varGen.Next(), ` := r.Intn(10)`)
p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`)
Expand Down
Loading

0 comments on commit a9cd0c3

Please sign in to comment.