-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
protoc-gen-twirp: use camel case for Go type name of proto msg (#146)
* protoc-gen-twirp: use camel case when parsing proto msg name * update license dates to 2019 * fix the same bug for nested messages
- Loading branch information
Showing
9 changed files
with
1,268 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2019 Twitch Interactive, Inc. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"). You may not | ||
// use this file except in compliance with the License. A copy of the License is | ||
// located at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// or in the "license" file accompanying this file. This file is distributed on | ||
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
// express or implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
|
||
package snake_case_names | ||
|
||
import "testing" | ||
|
||
func TestCompilation(t *testing.T) { | ||
// Test passes if this package compiles | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2019 Twitch Interactive, Inc. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"). You may not | ||
// use this file except in compliance with the License. A copy of the License is | ||
// located at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// or in the "license" file accompanying this file. This file is distributed on | ||
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
// express or implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
|
||
package snake_case_names | ||
|
||
//go:generate ../../protoc_gen.sh snake_case_names.proto |
175 changes: 175 additions & 0 deletions
175
internal/twirptest/snake_case_names/snake_case_names.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
internal/twirptest/snake_case_names/snake_case_names.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
syntax = "proto3"; | ||
|
||
// Test that protoc-gen-twirp follows the same behavior as protoc-gen-go | ||
// for converting RPCs and message names from snake case to camel case. | ||
package twirp.internal.twirptest.snake_case_names; | ||
option go_package = "snake_case_names"; | ||
|
||
message MakeHatArgs_v1 { | ||
message Hat_v1 { | ||
int32 size = 1; | ||
string color = 2; | ||
string name = 3; | ||
} | ||
|
||
message Size_v1 { | ||
int32 inches = 1; | ||
} | ||
} | ||
|
||
// A Haberdasher makes hats for clients. | ||
service Haberdasher { | ||
rpc MakeHat_v1 (MakeHatArgs_v1.Size_v1) returns (MakeHatArgs_v1.Hat_v1); | ||
} |
Oops, something went wrong.