diff --git a/internal/attestation/measurements/measurements.go b/internal/attestation/measurements/measurements.go index 9dc5e31d40e..a702706bd33 100644 --- a/internal/attestation/measurements/measurements.go +++ b/internal/attestation/measurements/measurements.go @@ -26,6 +26,7 @@ import ( "net/url" "sort" "strconv" + "strings" "github.com/edgelesssys/constellation/v2/internal/attestation/variant" "github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider" @@ -332,9 +333,9 @@ func (m *M) UnmarshalYAML(unmarshal func(any) error) error { // String returns a string representation of the measurements. func (m M) String() string { - returnString := "" + var returnString string for i, measurement := range m { - returnString += fmt.Sprintf("%d: 0x%s\n", i, hex.EncodeToString(measurement.Expected)) + returnString = strings.Join([]string{returnString, fmt.Sprintf("%d: 0x%s", i, hex.EncodeToString(measurement.Expected))}, ",") } return returnString }