I think the src\pkg\cryptosa\pkcs1v15_test.go
file in the Go source tree should be a good start.
An update striving provide more context… Go source contains many tests for the code in its standard library (and the crypto/rsa
package is a part of it), so whenever you have no idea how to use a standard package (or, actually, any other Go package), a good place to start is to look at the tests involving that package as testing code naturally uses the package! Tests are kept in files ending in _test.go
, usually have meaningful names and are located in the same directories actual code implementing a particular package is kept.
So in your particular case you could do this:
- Download the Go source package of the version matching your compiler (what
go version
shows) and unpack it somewhere.
- Navigate to the directory matching the package of interest. Code for standard Go packages is located in the "pkg" directory under the "src" top-level directory, so if you're interested in the
crypto/rsa
package, you need the src/pkg/crypto/rsa
directory.