]> Cypherpunks repositories - gostls13.git/commit
runtime/secret: warn users about allocations, loosen guarantees
authorDaniel Morsing <daniel.morsing@gmail.com>
Wed, 10 Dec 2025 10:13:05 +0000 (10:13 +0000)
committerDavid Chase <drchase@google.com>
Wed, 17 Dec 2025 15:29:24 +0000 (07:29 -0800)
commit516699848b7c19b2b7f80de82c66012719f6835b
tree77c2aba764a6780a21242b760359c051126cda9e
parent8c28ab936a1042fad8531583ff7737aa361e324a
runtime/secret: warn users about allocations, loosen guarantees

The discussion at #76477 warranted some stronger documentation about
what is expected from users of the secret package. In addition, #76764
presented a problem about when a user can expect their secrets to be
deleted.

Fix by loosening the guarantee to when all allocations from within a
secret function have been deemed unreachable. Provide some guidance for
users to steer them away from situations where allocations live on for
long after the secret function has finished executing

Fixes #76764.
Updates #76477.

Change-Id: I0cef3e7275737f32ec48f71355e588b3be26ea32
Reviewed-on: https://go-review.googlesource.com/c/go/+/728921
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/secret/doc.go [new file with mode: 0644]
src/runtime/secret/secret.go