Skip to content

Commit cc4f025

Browse files
committed
Drop redundant SopsPrefix constant in dotenv store
The dotenv package re-declared `SopsPrefix` with the same value as `stores.SopsPrefix`. Its only consumer was the package-local `HasSopsTopLevelKey`. Use `stores.SopsPrefix` directly so there is one declaration of the prefix, and remove the duplicate doc comment which also carried over a `metadatada` typo previously fixed in `metadata.go` (`04318bd2`). Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 parent a1e776c commit cc4f025

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

stores/dotenv/store.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import (
1010
"github.com/getsops/sops/v3/stores"
1111
)
1212

13-
// SopsPrefix is the prefix for all metadatada entry keys
14-
const SopsPrefix = stores.SopsMetadataKey + "_"
15-
1613
// Store handles storage of dotenv data
1714
type Store struct {
1815
config config.DotenvStoreConfig
@@ -139,7 +136,7 @@ func IsComplexValue(v interface{}) bool {
139136
func (store *Store) HasSopsTopLevelKey(branch sops.TreeBranch) bool {
140137
for _, b := range branch {
141138
if key, ok := b.Key.(string); ok {
142-
if strings.HasPrefix(key, SopsPrefix) {
139+
if strings.HasPrefix(key, stores.SopsPrefix) {
143140
return true
144141
}
145142
}

0 commit comments

Comments
 (0)