]> Cypherpunks repositories - gostls13.git/commit
crypto/hmac: rename CheckHMAC to ValidHMAC in package docs
authorsevki <s@sevki.org>
Sat, 17 Nov 2018 21:28:08 +0000 (21:28 +0000)
committerFilippo Valsorda <filippo@golang.org>
Sat, 17 Nov 2018 21:29:23 +0000 (21:29 +0000)
commit5001a38cc1a25850314a77bcde5df32371493236
tree16e467dc6bbf6638cb9190dc5f6b08aa52efa226
parenta889aaf8bfcf803eaed411ebae672cc6c52252bc
crypto/hmac: rename CheckHMAC to ValidHMAC in package docs

Procedure names should reflect what they do; function names
should reflect what they return. Functions are used in
expressions, often in things like if's, so they need
to read appropriately.

        if CheckHMAC(a, b, key)

is unhelpful because we can't deduce whether CheckHMAC
returns true on error or nonĀ­-error; instead

        if ValidHMAC(a, b, key)

makes the point clear and makes a future mistake
in using the routine less likely.

https://www.lysator.liu.se/c/pikestyle.html

Change-Id: I7c4b1981c90c8d7475ddd8ec18dee3db2e0f42df
GitHub-Last-Rev: 32199a418b5e5507259fa4b6715da8a9c185f90a
GitHub-Pull-Request: golang/go#28823
Reviewed-on: https://go-review.googlesource.com/c/149857
Reviewed-by: Filippo Valsorda <filippo@golang.org>
src/crypto/hmac/hmac.go