pkg/reference: Spec.String(): use string-concatenation instead of sprintf
These were straight concatenations of strings; reduce some allocations by removing fmt.Sprintf for this. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
7a0687f6c8
commit
799bca97f2
@ -18,7 +18,6 @@ package reference
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"path"
|
||||
"regexp"
|
||||
@ -146,10 +145,10 @@ func (r Spec) String() string {
|
||||
return r.Locator
|
||||
}
|
||||
if r.Object[:1] == "@" {
|
||||
return fmt.Sprintf("%v%v", r.Locator, r.Object)
|
||||
return r.Locator + r.Object
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%v:%v", r.Locator, r.Object)
|
||||
return r.Locator + ":" + r.Object
|
||||
}
|
||||
|
||||
// SplitObject provides two parts of the object spec, delimited by an `@`
|
||||
|
Loading…
Reference in New Issue
Block a user