]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/cipher, math/big: fix example names
authorJosh Bleecher Snyder <josharian@gmail.com>
Sat, 9 Jul 2016 21:51:00 +0000 (14:51 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 16 Aug 2016 14:36:32 +0000 (14:36 +0000)
Fixes (legit) vet warnings.
Fix some verb tenses while we're here.

Updates #11041

Change-Id: I27e995f55b38f4cf584e97a67b8545e8247e83d6
Reviewed-on: https://go-review.googlesource.com/27122
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/crypto/cipher/example_test.go
src/math/big/floatexample_test.go

index 9abe782bca54aec85416bb8a72ea64127b934adb..956cc2eaca6333c065f2dda51e0e90c0349399c7 100644 (file)
@@ -14,7 +14,7 @@ import (
        "os"
 )
 
-func ExampleNewGCMEncrypter() {
+func ExampleNewGCM_encrypt() {
        // The key argument should be the AES key, either 16 or 32 bytes
        // to select AES-128 or AES-256.
        key := []byte("AES256Key-32Characters1234567890")
@@ -40,7 +40,7 @@ func ExampleNewGCMEncrypter() {
        fmt.Printf("%x\n", ciphertext)
 }
 
-func ExampleNewGCMDecrypter() {
+func ExampleNewGCM_decrypt() {
        // The key argument should be the AES key, either 16 or 32 bytes
        // to select AES-128 or AES-256.
        key := []byte("AES256Key-32Characters1234567890")
index fb799d5a1f396a132a44a1f9dd8be41dd7f8f5a1..0c6668c93bc592edafc9a826a877f19af1ca35bc 100644 (file)
@@ -11,7 +11,7 @@ import (
 )
 
 func ExampleFloat_Add() {
-       // Operating on numbers of different precision.
+       // Operate on numbers of different precision.
        var x, y, z big.Float
        x.SetInt64(1000)          // x is automatically set to 64bit precision
        y.SetFloat64(2.718281828) // y is automatically set to 53bit precision
@@ -26,8 +26,8 @@ func ExampleFloat_Add() {
        // z = 1002.718282 (0x.faadf854p+10, prec = 32, acc = Below)
 }
 
-func Example_Shift() {
-       // Implementing Float "shift" by modifying the (binary) exponents directly.
+func ExampleFloat_shift() {
+       // Implement Float "shift" by modifying the (binary) exponents directly.
        for s := -5; s <= 5; s++ {
                x := big.NewFloat(0.5)
                x.SetMantExp(x, x.MantExp(nil)+s) // shift x by s