From c5dc3fc9559239afcaea9ce60f9d4d056a8e2709 Mon Sep 17 00:00:00 2001 From: Josh McSavaney Date: Sat, 19 Apr 2025 14:50:50 -0400 Subject: [PATCH] Use the correct form of `sha256.Sum256`. `sha256.New().Sum(foo)` appends the SHA-256 hash for nil to foo. See https://go.dev/play/p/vSW0U3Hq4qk --- internal/commands/interceptor/process.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/commands/interceptor/process.go b/internal/commands/interceptor/process.go index eaa59687..9fbc7f29 100644 --- a/internal/commands/interceptor/process.go +++ b/internal/commands/interceptor/process.go @@ -83,7 +83,7 @@ func parseProcess(required bool, idFlagName, nameFlagName, instanceIDFlagName st if instanceID == "" { return fmt.Errorf(`"--%s" is specified but its related service name or id is not given`, nameFlagName) } - id = fmt.Sprintf("%x", sha256.New().Sum([]byte(fmt.Sprintf("%s_%s", instanceID, name)))) + id = fmt.Sprintf("%x", sha256.Sum256([]byte(fmt.Sprintf("%s_%s", instanceID, name)))) } return ctx.Set(idFlagName, id)