Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
2256c6e6
Commit
2256c6e6
authored
Jul 20, 2016
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix String protobuf generator
parent
2c4a9f2e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
11 deletions
+9
-11
parser.go
cmd/libs/go2idl/go-to-protobuf/protobuf/parser.go
+1
-1
generated.pb.go
pkg/apis/authentication/v1beta1/generated.pb.go
+0
-10
generated.proto
pkg/apis/authentication/v1beta1/generated.proto
+1
-0
types.go
pkg/apis/authentication/v1beta1/types.go
+7
-0
No files found.
cmd/libs/go2idl/go-to-protobuf/protobuf/parser.go
View file @
2256c6e6
...
...
@@ -132,7 +132,7 @@ func rewriteOptionalMethods(decl ast.Decl, isOptional OptionalFunc) {
switch
t
.
Name
.
Name
{
case
"Unmarshal"
:
ast
.
Walk
(
&
optionalItemsVisitor
{},
t
.
Body
)
case
"MarshalTo"
,
"Size"
:
case
"MarshalTo"
,
"Size"
,
"String"
:
ast
.
Walk
(
&
optionalItemsVisitor
{},
t
.
Body
)
fallthrough
case
"Marshal"
:
...
...
pkg/apis/authentication/v1beta1/generated.pb.go
View file @
2256c6e6
...
...
@@ -376,16 +376,6 @@ func sovGenerated(x uint64) (n int) {
func
sozGenerated
(
x
uint64
)
(
n
int
)
{
return
sovGenerated
(
uint64
((
x
<<
1
)
^
uint64
((
int64
(
x
)
>>
63
))))
}
func
(
this
*
ExtraValue
)
String
()
string
{
if
this
==
nil
{
return
"nil"
}
s
:=
strings
.
Join
([]
string
{
`&ExtraValue{`
,
`Items:`
+
fmt
.
Sprintf
(
"%v"
,
this
.
Items
)
+
`,`
,
`}`
,
},
""
)
return
s
}
func
(
this
*
TokenReview
)
String
()
string
{
if
this
==
nil
{
return
"nil"
...
...
pkg/apis/authentication/v1beta1/generated.proto
View file @
2256c6e6
...
...
@@ -32,6 +32,7 @@ option go_package = "v1beta1";
// ExtraValue masks the value so protobuf can generate
// +protobuf.nullable=true
// +protobuf.options.(gogoproto.goproto_stringer)=false
message
ExtraValue
{
// items, if empty, will result in an empty slice
...
...
pkg/apis/authentication/v1beta1/types.go
View file @
2256c6e6
...
...
@@ -17,6 +17,8 @@ limitations under the License.
package
v1beta1
import
(
"fmt"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/v1"
)
...
...
@@ -72,4 +74,9 @@ type UserInfo struct {
// ExtraValue masks the value so protobuf can generate
// +protobuf.nullable=true
// +protobuf.options.(gogoproto.goproto_stringer)=false
type
ExtraValue
[]
string
func
(
t
ExtraValue
)
String
()
string
{
return
fmt
.
Sprintf
(
"%v"
,
[]
string
(
t
))
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment