Source file src/crypto/rand/example_test.go

     1  // Copyright 2011 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package rand_test
     6  
     7  import "crypto/rand"
     8  
     9  func ExampleRead() {
    10  	// Note that no error handling is necessary, as Read always succeeds.
    11  	key := make([]byte, 32)
    12  	rand.Read(key)
    13  }
    14  

View as plain text