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
```
This commit is contained in:
Kubernetes Submit Queue 2018-06-20 05:48:19 -07:00 committed by GitHub
commit b309d18a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -48,7 +48,7 @@ func (v *Error) ErrorBody() string {
var s string
switch v.Type {
case ErrorTypeRequired, ErrorTypeForbidden, ErrorTypeTooLong, ErrorTypeInternal:
s = fmt.Sprintf("%s", v.Type)
s = v.Type.String()
default:
value := v.BadValue
valueType := reflect.TypeOf(value)

View File

@ -80,7 +80,7 @@ func (l *ListNode) append(n Node) {
}
func (l *ListNode) String() string {
return fmt.Sprintf("%s", l.Type())
return l.Type().String()
}
// TextNode holds plain text.
@ -210,7 +210,7 @@ func newWildcard() *WildcardNode {
}
func (i *WildcardNode) String() string {
return fmt.Sprintf("%s", i.Type())
return i.Type().String()
}
// RecursiveNode means a recursive descent operator
@ -223,7 +223,7 @@ func newRecursive() *RecursiveNode {
}
func (r *RecursiveNode) String() string {
return fmt.Sprintf("%s", r.Type())
return r.Type().String()
}
// UnionNode is union of ListNode
@ -237,7 +237,7 @@ func newUnion(nodes []*ListNode) *UnionNode {
}
func (u *UnionNode) String() string {
return fmt.Sprintf("%s", u.Type())
return u.Type().String()
}
// BoolNode holds bool value