Imports #
"cmd/go/internal/base"
"cmd/go/internal/cfg"
"cmd/go/internal/fsys"
"cmd/go/internal/modfetch"
"cmd/go/internal/str"
"context"
"os"
"path"
"path/filepath"
"strings"
"golang.org/x/mod/module"
"golang.org/x/mod/semver"
"cmd/go/internal/base"
"cmd/go/internal/cfg"
"cmd/go/internal/fsys"
"cmd/go/internal/modfetch"
"cmd/go/internal/str"
"context"
"os"
"path"
"path/filepath"
"strings"
"golang.org/x/mod/module"
"golang.org/x/mod/semver"
var dir stringvar initDone boolvar version stringDir reports the directory containing the crypto/internal/fips140 source code. If Snapshot() is false, Dir returns GOROOT/src/crypto/internal/fips140. Otherwise Dir ensures that the snapshot has been unpacked into the module cache and then returns the directory in the module cache corresponding to the crypto/internal/fips140 directory.
func Dir() stringEnabled reports whether FIPS mode is enabled at all. That is, it reports whether GOFIPS140 is set to something besides "off".
func Enabled() boolInit initializes the FIPS settings. It must be called before using any other functions in this package. If initialization fails, Init calls base.Fatalf.
func Init()ResolveImport resolves the import path imp. If it is of the form crypto/internal/fips140/foo (not crypto/internal/fips140/v1.2.3/foo) and we are using a snapshot, then LookupImport rewrites the path to crypto/internal/fips140/v1.2.3/foo and returns that path and its location in the unpacked FIPS snapshot.
func ResolveImport(imp string) (newPath string, dir string, ok bool)Snapshot reports whether FIPS mode is using a source snapshot rather than $GOROOT/src/crypto/internal/fips140. That is, it reports whether GOFIPS140 is set to something besides "latest" or "off".
func Snapshot() boolVersion reports the GOFIPS140 version in use, which is either "off", "latest", or a version like "v1.2.3". If GOFIPS140 is set to an alias like "inprocess" or "certified", Version returns the underlying version.
func Version() stringcheckInit panics if Init has not been called.
func checkInit()func initDir()func initVersion()Generated with Arrow