]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/pbkdf2: add missing error return value in example
authorFelix Stein <bystones@users.noreply.github.com>
Thu, 23 Oct 2025 20:27:03 +0000 (20:27 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 23 Oct 2025 21:44:03 +0000 (14:44 -0700)
This function returns two values, one was missing in the example.

Change-Id: I738597f959011260f666c29b7d3ffad8e5cdc473
GitHub-Last-Rev: 5d99e04f7e1168fd0627e965508181bdb9d1ac25
GitHub-Pull-Request: golang/go#76032
Reviewed-on: https://go-review.googlesource.com/c/go/+/714420
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
src/crypto/pbkdf2/pbkdf2.go

index dff2e6cb355c5f4ae7aafd680c6f6eaa39c26b6a..01fd12e40e341ef9a3475329f1baa0973a34be64 100644 (file)
@@ -27,7 +27,7 @@ import (
 // can get a derived key for e.g. AES-256 (which needs a 32-byte key) by
 // doing:
 //
-//     dk := pbkdf2.Key(sha1.New, "some password", salt, 4096, 32)
+//     dk, err := pbkdf2.Key(sha1.New, "some password", salt, 4096, 32)
 //
 // Remember to get a good random salt. At least 8 bytes is recommended by the
 // RFC.