Skip to content

Commit 8621559

Browse files
committed
Apply review nits to metadata helpers
Lower-case the doc comment on `metadataFromInternal` to match the unexported function name, wrap it to ~80 columns, and terminate it with a period. Replace `i -= 1` with `i--` in the `MetadataFlattenFull` branch of `ExtractMetadata` to match the incrementor style used in the loop body of the other branch. Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 parent f14527d commit 8621559

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

stores/metadata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func ExtractMetadata(branches sops.TreeBranches, opts MetadataOpts) (sops.TreeBr
127127
entry.Key = key[len(SopsPrefix):]
128128
metadataTree = append(metadataTree, entry)
129129
branch = append(branch[:i], branch[i+1:]...)
130-
i -= 1
130+
i--
131131
}
132132
}
133133
}

stores/stores.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ type hckmskey struct {
114114
EncryptedDataKey string `mapstructure:"enc"`
115115
}
116116

117-
// MetadataFromInternal converts an internal SOPS metadata representation to a representation appropriate for storage
117+
// metadataFromInternal converts an internal SOPS metadata representation to a
118+
// representation appropriate for storage.
118119
func metadataFromInternal(sopsMetadata sops.Metadata) metadata {
119120
var m metadata
120121
m.LastModified = sopsMetadata.LastModified.Format(time.RFC3339)

0 commit comments

Comments
 (0)