Unverified Commit b309d18a authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #64506 from wgliang/master.simple-string

Automatic merge from submit-queue (batch tested with PRs 64688, 64451, 64504, 64506, 56358). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. replace fmt.Sprintf(%s, i.Type()) with i.Type().String() **What this PR does / why we need it**: /kind cleanup replace fmt.Sprintf(%s, i.Type()) with i.Type().String() **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents 2fa32e71 17ad3eaa
...@@ -48,7 +48,7 @@ func (v *Error) ErrorBody() string { ...@@ -48,7 +48,7 @@ func (v *Error) ErrorBody() string {
var s string var s string
switch v.Type { switch v.Type {
case ErrorTypeRequired, ErrorTypeForbidden, ErrorTypeTooLong, ErrorTypeInternal: case ErrorTypeRequired, ErrorTypeForbidden, ErrorTypeTooLong, ErrorTypeInternal:
s = fmt.Sprintf("%s", v.Type) s = v.Type.String()
default: default:
value := v.BadValue value := v.BadValue
valueType := reflect.TypeOf(value) valueType := reflect.TypeOf(value)
......
...@@ -80,7 +80,7 @@ func (l *ListNode) append(n Node) { ...@@ -80,7 +80,7 @@ func (l *ListNode) append(n Node) {
} }
func (l *ListNode) String() string { func (l *ListNode) String() string {
return fmt.Sprintf("%s", l.Type()) return l.Type().String()
} }
// TextNode holds plain text. // TextNode holds plain text.
...@@ -210,7 +210,7 @@ func newWildcard() *WildcardNode { ...@@ -210,7 +210,7 @@ func newWildcard() *WildcardNode {
} }
func (i *WildcardNode) String() string { func (i *WildcardNode) String() string {
return fmt.Sprintf("%s", i.Type()) return i.Type().String()
} }
// RecursiveNode means a recursive descent operator // RecursiveNode means a recursive descent operator
...@@ -223,7 +223,7 @@ func newRecursive() *RecursiveNode { ...@@ -223,7 +223,7 @@ func newRecursive() *RecursiveNode {
} }
func (r *RecursiveNode) String() string { func (r *RecursiveNode) String() string {
return fmt.Sprintf("%s", r.Type()) return r.Type().String()
} }
// UnionNode is union of ListNode // UnionNode is union of ListNode
...@@ -237,7 +237,7 @@ func newUnion(nodes []*ListNode) *UnionNode { ...@@ -237,7 +237,7 @@ func newUnion(nodes []*ListNode) *UnionNode {
} }
func (u *UnionNode) String() string { func (u *UnionNode) String() string {
return fmt.Sprintf("%s", u.Type()) return u.Type().String()
} }
// BoolNode holds bool value // BoolNode holds bool value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment