Skip to content

Commit 815f422

Browse files
committed
use struct instead of bytes
1 parent fc5a6a3 commit 815f422

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

internal/image/validate.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func ValidateImage(ctx context.Context, imageRef, policyConfiguration, publicKey
104104
}
105105

106106
func writeCommitData(attestations []attestation, commitFile string) error {
107-
payloads := make([]string, 0, len(attestations))
107+
payloads := make([]*signOffSignature, 0, len(attestations))
108108
for _, att := range attestations {
109109
signoffSource, err := att.NewSignOffSource()
110110
if err != nil {
@@ -120,11 +120,7 @@ func writeCommitData(attestations []attestation, commitFile string) error {
120120
}
121121

122122
if signOff != nil {
123-
payload, err := json.MarshalIndent(signOff, "", " ")
124-
if err != nil {
125-
return err
126-
}
127-
payloads = append(payloads, string(payload))
123+
payloads = append(payloads, signOff)
128124
}
129125
}
130126

0 commit comments

Comments
 (0)