FAQ
https://codereview.appspot.com/6631044/diff/1002/src/pkg/crypto/cipher/example_test.go
File src/pkg/crypto/cipher/example_test.go (right):

https://codereview.appspot.com/6631044/diff/1002/src/pkg/crypto/cipher/example_test.go#newcode16
src/pkg/crypto/cipher/example_test.go:16: func
ExampleNewCBCDecrypter(key, ciphertext []byte) ([]byte, error) {
On 2012/10/08 19:42:23, agl1 wrote:
On 2012/10/08 19:38:12, minux wrote:
example functions can't take arguments.
Although the arguments don't appear in the example, I think it's
clearer here to
have a free variable called `key', than to fluff around with reading a random
key and distract from the subject of the example.
If you have actual key, ciphertext, and plaintext globals then you can
actually make these examples executable by including an Output: comment
at the end of the function.

As they are, the user doesn't see the functions signature so the return
statements are a non-sequitur.

https://codereview.appspot.com/6631044/

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedOct 12, '12 at 1:41a
activeOct 12, '12 at 1:41a
posts1
users1
websitegolang.org

1 user in discussion

Adg: 1 post

People

Translate

site design / logo © 2022 Grokbase