File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ func cloneTagsWithMap(original []string, newTags map[string]string) []string {
3232
3333 i := len (original )
3434 for k , v := range newTags {
35- combined [i ] = fmt . Sprintf ( "%s:%s" , k , v )
35+ combined [i ] = buildTag ( k , v )
3636 i ++
3737 }
3838
@@ -44,12 +44,21 @@ func mapToStrings(tagMap map[string]string) []string {
4444 tags := make ([]string , 0 , len (tagMap ))
4545
4646 for k , v := range tagMap {
47- tags = append (tags , fmt . Sprintf ( "%s:%s" , k , v ))
47+ tags = append (tags , buildTag ( k , v ))
4848 }
4949
5050 return tags
5151}
5252
53+ func buildTag (k , v string ) string {
54+ var b strings.Builder
55+ b .Grow (len (k ) + len (v ) + 1 )
56+ b .WriteString (k )
57+ b .WriteByte (':' )
58+ b .WriteString (v )
59+ return b .String ()
60+ }
61+
5362// convertType converts a value into an specific type if possible, otherwise
5463// panics. The returned interface is guaranteed to cast properly.
5564func convertType (value interface {}, toType reflect.Type ) interface {} {
You can’t perform that action at this time.
0 commit comments