replace fmt.Sprintf(%s, i.Type()) with i.Type().String()

Kubernetes-commit: 17ad3eaa26b4ecf2759eadb01ab91af6ae292a3c
This commit is contained in:
Guoliang Wang
2018-05-30 18:18:58 +08:00
committed by Kubernetes Publisher
parent 157b02554c
commit 5037893508

View File

@@ -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 {
} }
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 {
} }
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 {
} }
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