Răsfoiți Sursa

string builder versus buffer

Ajay Tripathy 4 ani în urmă
părinte
comite
74566acc75
1 a modificat fișierele cu 1 adăugiri și 2 ștergeri
  1. 1 2
      pkg/kubecost/asset.go

+ 1 - 2
pkg/kubecost/asset.go

@@ -1,7 +1,6 @@
 package kubecost
 package kubecost
 
 
 import (
 import (
-	"bytes"
 	"encoding"
 	"encoding"
 	"fmt"
 	"fmt"
 	"strings"
 	"strings"
@@ -247,7 +246,7 @@ func AssetToExternalAllocation(asset Asset, aggregateBy []string, labelConfig *L
 // Valid values of `aggregateBy` elements are strings which are an `AssetProperty`, and strings prefixed
 // Valid values of `aggregateBy` elements are strings which are an `AssetProperty`, and strings prefixed
 // with `"label:"`.
 // with `"label:"`.
 func key(a Asset, aggregateBy []string) (string, error) {
 func key(a Asset, aggregateBy []string) (string, error) {
-	var buffer bytes.Buffer
+	var buffer strings.Builder
 
 
 	if aggregateBy == nil {
 	if aggregateBy == nil {
 		aggregateBy = []string{
 		aggregateBy = []string{