Skip to content

Commit

Permalink
rewrote String method to only use one line
Browse files Browse the repository at this point in the history
  • Loading branch information
miampf committed Apr 3, 2024
1 parent fd9a8b8 commit 83808a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/attestation/measurements/measurements.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 83808a0

Please sign in to comment.