Skip to content

Commit 1d499ab

Browse files
authored
Use the correct form of sha1.Sum (#111)
sha1.New().Sum(x) appends a hash of nothing to x. See https://go.dev/play/p/h6pGFHEzbfA
1 parent 2d2a7c2 commit 1d499ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

metrics/servicediscovery.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (sd *AzureServiceDiscovery) fetchResourceList(subscriptionId, filter string
4141
// nolint:gosec
4242
cacheKey := fmt.Sprintf(
4343
"%x",
44-
string(sha1.New().Sum([]byte(fmt.Sprintf("%v:%v", subscriptionId, filter)))),
44+
sha1.Sum([]byte(fmt.Sprintf("%v:%v", subscriptionId, filter))),
4545
)
4646

4747
// try to fetch info from cache

0 commit comments

Comments
 (0)