Skip to content

Commit 1d06d3f

Browse files
committed
Use the correct form of md5.Sum.
`md5.New().Sum(foo)` appends the MD5 hash for nil to foo. See https://go.dev/play/p/vSW0U3Hq4qk (different algo but same issue). Signed-off-by: Josh McSavaney <[email protected]>
1 parent 39d7233 commit 1d06d3f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/gitutil/gitutil.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ func (gur *GitUpstreamRepo) getRepoDir(uri string) string {
335335
var hash = md5.Sum([]byte(uri))
336336
return strings.ToLower(hex.EncodeToString(hash[:]))
337337
}
338-
return strings.ToLower(base32.StdEncoding.EncodeToString(md5.New().Sum([]byte(uri))))
338+
sum := md5.Sum([]byte(uri))
339+
return strings.ToLower(base32.StdEncoding.EncodeToString(sum[:]))
339340
}
340341

341342
// getRepoCacheDir

0 commit comments

Comments
 (0)