modindex

Imports

Imports #

"cmd/go/internal/base"
"encoding/binary"
"go/token"
"sort"
"bytes"
"cmd/go/internal/fsys"
"cmd/go/internal/str"
"errors"
"fmt"
"go/ast"
"go/build"
"go/build/constraint"
"go/token"
"internal/syslist"
"io"
"io/fs"
"path/filepath"
"sort"
"strings"
"unicode"
"unicode/utf8"
"bufio"
"bytes"
"errors"
"fmt"
"go/ast"
"go/build"
"go/parser"
"go/token"
"io"
"strconv"
"strings"
"unicode"
"unicode/utf8"
"bytes"
"encoding/binary"
"errors"
"fmt"
"go/build"
"go/build/constraint"
"go/token"
"internal/godebug"
"internal/goroot"
"path"
"path/filepath"
"runtime"
"runtime/debug"
"sort"
"strings"
"sync"
"time"
"unsafe"
"cmd/go/internal/base"
"cmd/go/internal/cache"
"cmd/go/internal/cfg"
"cmd/go/internal/fsys"
"cmd/go/internal/imports"
"cmd/go/internal/str"
"cmd/internal/par"
"cmd/go/internal/base"
"cmd/go/internal/fsys"
"cmd/go/internal/str"
"encoding/json"
"errors"
"fmt"
"go/build"
"go/doc"
"go/scanner"
"go/token"
"io/fs"
"path/filepath"
"strings"

Constants & Variables

ErrNotIndexed var #

var ErrNotIndexed = *ast.CallExpr

bPlusBuild var #

var bPlusBuild = *ast.CallExpr

bSlashSlash var #

var bSlashSlash = *ast.CallExpr

bSlashStar var #

var bSlashStar = *ast.CallExpr

bStarSlash var #

var bStarSlash = *ast.CallExpr

binaryOnlyComment var #

Special comment denoting a binary-only package. See https://golang.org/design/2775-binary-only-packages for more about the design of binary-only packages.

var binaryOnlyComment = *ast.CallExpr

bom var #

var bom = []byte{...}

defaultReleaseTags var #

var defaultReleaseTags []string

defaultToolTags var #

var defaultToolTags []string

dummyPkg var #

var dummyPkg build.Package

enabled var #

enabled is used to flag off the behavior of the module index on tip, for debugging.

var enabled = *ast.BinaryExpr

errCannotFindPackage var #

var errCannotFindPackage = *ast.CallExpr

errCorrupt var #

var errCorrupt = *ast.CallExpr

errDisabled var #

var errDisabled = *ast.CallExpr

errFIPS140 var #

var errFIPS140 = *ast.CallExpr

errMultipleGoBuild var #

var errMultipleGoBuild = *ast.CallExpr

errNUL var #

var errNUL = *ast.CallExpr

errNoModules var #

var errNoModules = *ast.CallExpr

errNonSource var #

var errNonSource = *ast.CallExpr

errNotFromModuleCache var #

var errNotFromModuleCache = *ast.CallExpr

errSyntax var #

var errSyntax = *ast.CallExpr

goBuildComment var #

var goBuildComment = *ast.CallExpr

goEmbed var #

var goEmbed = *ast.CallExpr

indexVersion const #

const indexVersion = "go index v2"

installgorootAll var #

var installgorootAll = *ast.BinaryExpr

isTest var #

var isTest = false

mcache var #

var mcache *ast.IndexListExpr

modTimeCutoff const #

const modTimeCutoff = *ast.BinaryExpr

newline var #

var newline = *ast.CallExpr

pcache var #

var pcache *ast.IndexListExpr

safeString const #

NOTE: $ is not safe for the shell, but it is allowed here because of linker options like -Wl,$ORIGIN. We never pass these arguments to a shell (just to programs we construct argv for), so this should be okay. See golang.org/issue/6038. The @ is for OS X. See golang.org/issue/13720. The % is for Jenkins. See golang.org/issue/16959. The ! is because module paths may use them. See golang.org/issue/26716. The ~ and ^ are for sr.ht. See golang.org/issue/32260.

const safeString = "+-.,/0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz:$@%! ~^"

slashSlash var #

var slashSlash = *ast.CallExpr

slashStar var #

var slashStar = *ast.CallExpr

sourceFileBinaryOnly const #

Offsets for fields in the sourceFile.

const sourceFileBinaryOnly

sourceFileCgoDirectives const #

Offsets for fields in the sourceFile.

const sourceFileCgoDirectives

sourceFileError const #

Offsets for fields in the sourceFile.

const sourceFileError = *ast.BinaryExpr

sourceFileGoBuildConstraint const #

Offsets for fields in the sourceFile.

const sourceFileGoBuildConstraint

sourceFileIgnoreFile const #

Offsets for fields in the sourceFile.

const sourceFileIgnoreFile

sourceFileName const #

Offsets for fields in the sourceFile.

const sourceFileName

sourceFileNumPlusBuildConstraints const #

Offsets for fields in the sourceFile.

const sourceFileNumPlusBuildConstraints

sourceFileParseError const #

Offsets for fields in the sourceFile.

const sourceFileParseError

sourceFilePkgName const #

Offsets for fields in the sourceFile.

const sourceFilePkgName

sourceFileSynopsis const #

Offsets for fields in the sourceFile.

const sourceFileSynopsis

starSlash var #

var starSlash = *ast.CallExpr

Structs

Context struct #

A Context specifies the supporting context for a build.

type Context struct {
GOARCH string
GOOS string
GOROOT string
GOPATH string
Dir string
CgoEnabled bool
UseAllFiles bool
Compiler string
BuildTags []string
ToolTags []string
ReleaseTags []string
InstallSuffix string
JoinPath func(elem ...string) string
SplitPathList func(list string) []string
IsAbsPath func(path string) bool
IsDir func(path string) bool
HasSubdir func(root string, dir string) (rel string, ok bool)
ReadDir func(dir string) ([]fs.FileInfo, error)
OpenFile func(path string) (io.ReadCloser, error)
}

IndexPackage struct #

IndexPackage holds the information in the index needed to load a package in a specific directory.

type IndexPackage struct {
error error
dir string
modroot string
sourceFiles []*sourceFile
}

Module struct #

Module represents and encoded module index file. It is used to do the equivalent of build.Import of packages in the module and answer other questions based on the index file's data.

type Module struct {
modroot string
d *decoder
n int
}

MultiplePackageError struct #

MultiplePackageError describes a directory containing multiple buildable Go source files for multiple packages.

type MultiplePackageError struct {
Dir string
Packages []string
Files []string
}

NoGoError struct #

NoGoError is the error used by Import to describe a directory containing no buildable Go source files. (It may still contain test files, files hidden by build tags, and so on.)

type NoGoError struct {
Dir string
}

decoder struct #

A decoder helps decode the index format.

type decoder struct {
data []byte
str []byte
}

embed struct #

type embed struct {
pattern string
position token.Position
}

encoder struct #

type encoder struct {
b []byte
stringTable []byte
strings map[string]int
}

fileEmbed struct #

type fileEmbed struct {
pattern string
pos token.Position
}

fileImport struct #

type fileImport struct {
path string
pos token.Pos
doc *ast.CommentGroup
}

fileInfo struct #

fileInfo records information learned about a file included in a build.

type fileInfo struct {
name string
header []byte
fset *token.FileSet
parsed *ast.File
parseErr error
imports []fileImport
embeds []fileEmbed
directives []build.Directive
binaryOnly bool
goBuildConstraint string
plusBuildConstraints []string
}

importReader struct #

type importReader struct {
b *bufio.Reader
buf []byte
peek byte
err error
eof bool
nerr int
pos token.Position
}

parseError struct #

type parseError struct {
ErrorList *scanner.ErrorList
ErrorString string
}

rawFile struct #

rawFile is the struct representation of the file holding all information in its fields.

type rawFile struct {
error string
parseError string
name string
synopsis string
pkgName string
ignoreFile bool
binaryOnly bool
cgoDirectives string
goBuildConstraint string
plusBuildConstraints []string
imports []rawImport
embeds []embed
directives []build.Directive
}

rawImport struct #

type rawImport struct {
path string
position token.Position
}

rawPackage struct #

rawPackage holds the information from each package that's needed to fill a build.Package once the context is available.

type rawPackage struct {
error string
dir string
sourceFiles []*rawFile
}

reader struct #

A reader reads sequential fields from a section of the index format.

type reader struct {
d *decoder
pos int
}

sourceFile struct #

sourceFile represents the information of a given source file in the module index.

type sourceFile struct {
d *decoder
pos int
onceReadImports sync.Once
savedImports []rawImport
}

Functions

Bool method #

func (e *encoder) Bool(b bool)

Bytes method #

func (e *encoder) Bytes(b []byte)

Error method #

func (e *MultiplePackageError) Error() string

Error method #

func (e *NoGoError) Error() string

GetModule function #

GetModule returns the Module for the given modroot. It will return ErrNotIndexed if the directory should be read without using the index, for instance because the index is disabled, or the package is not in a module.

func GetModule(modroot string) (*Module, error)

GetPackage function #

GetPackage returns the IndexPackage for the directory at the given path. It will return ErrNotIndexed if the directory should be read without using the index, for instance because the index is disabled, or the package is not in a module.

func GetPackage(modroot string, pkgdir string) (*IndexPackage, error)

Import method #

Import is the equivalent of build.Import given the information in Module.

func (rp *IndexPackage) Import(bctxt build.Context, mode build.ImportMode) (p *build.Package, err error)

Int method #

Int encodes n. Note that all ints are written to the index as uint32s, and to avoid problems on 32-bit systems we require fitting into a 32-bit int.

func (e *encoder) Int(n int)

IntAt method #

func (e *encoder) IntAt(n int, at int)

IsGoDir method #

IsGoDir is the equivalent of fsys.IsGoDir using the information in the index.

func (rp *IndexPackage) IsGoDir() (_ bool, err error)

IsStandardPackage function #

IsStandardPackage reports whether path is a standard package for the goroot and compiler using the module index if possible, and otherwise falling back to internal/goroot.IsStandardPackage

func IsStandardPackage(goroot_ string, compiler string, path string) bool

Package method #

Package and returns finds the package with the given path (relative to the module root). If the package does not exist, Package returns an IndexPackage that will return an appropriate error from its methods.

func (m *Module) Package(path string) *IndexPackage

Pos method #

func (e *encoder) Pos() int

Position method #

func (e *encoder) Position(position token.Position)

ScanDir method #

ScanDir implements imports.ScanDir using the information in the index.

func (rp *IndexPackage) ScanDir(tags map[string]bool) (sortedImports []string, sortedTestImports []string, err error)

String method #

func (e *encoder) String(s string)

Uint32 method #

func (e *encoder) Uint32(n uint32)

Walk method #

Walk calls f for each package in the index, passing the path to that package relative to the module root.

func (m *Module) Walk(f func(path string))

asString function #

func asString(b []byte) string

binaryOnly method #

func (sf *sourceFile) binaryOnly() bool

bool method #

bool reads the next bool.

func (r *reader) bool() bool

boolAt method #

boolAt returns the bool at the given offset in d.data.

func (d *decoder) boolAt(off int) bool

cgoDirectives method #

func (sf *sourceFile) cgoDirectives() string

cleanDecls function #

func cleanDecls(m map[string][]token.Position) ([]string, map[string][]token.Position)

dirHash function #

dirHash returns an ActionID corresponding to the state of the package located at filesystem path pkgdir.

func dirHash(modroot string, pkgdir string) (cache.ActionID, error)

directives method #

func (sf *sourceFile) directives() []build.Directive

directivesOffset method #

func (sf *sourceFile) directivesOffset() int

embeds method #

func (sf *sourceFile) embeds() []embed

embedsOffset method #

func (sf *sourceFile) embedsOffset() int

encodeFile function #

func encodeFile(e *encoder, f *rawFile)

encodeModuleBytes function #

encodeModuleBytes produces the encoded representation of the module index. encodeModuleBytes may modify the packages slice.

func encodeModuleBytes(packages []*rawPackage) []byte

encodePackage function #

func encodePackage(e *encoder, p *rawPackage)

encodePackageBytes function #

func encodePackageBytes(p *rawPackage) []byte

error method #

func (sf *sourceFile) error() string

eval method #

func (ctxt *Context) eval(x constraint.Expr, allTags map[string]bool) bool

expandSrcDir function #

expandSrcDir expands any occurrence of ${SRCDIR}, making sure the result is safe for the shell.

func expandSrcDir(str string, srcdir string) (string, bool)

extractCgoDirectives function #

extractCgoDirectives filters only the lines containing #cgo directives from the input, which is the comment on import "C".

func extractCgoDirectives(doc string) []string

fileListForExt function #

func fileListForExt(p *build.Package, ext string) *[]string

findEmbed method #

findEmbed advances the input reader to the next //go:embed comment. It reports whether it found a comment. (Otherwise it found an error or EOF.)

func (r *importReader) findEmbed(first bool) bool

findImportComment function #

func findImportComment(data []byte) (s string, line int)

fromBytes function #

fromBytes returns a *Module given the encoded representation.

func fromBytes(moddir string, data []byte) (m *Module, err error)

getConstraints function #

func getConstraints(content []byte) (goBuild string, plusBuild []string, binaryOnly bool, err error)

getFileInfo function #

getFileInfo extracts the information needed from each go file for the module index. If Name denotes a Go program, matchFile reads until the end of the Imports and returns that section of the file in the FileInfo's Header field, even though it only considers text until the first non-comment for +build lines. getFileInfo will return errNonSource if the file is not a source or object file and shouldn't even be added to IgnoredFiles.

func getFileInfo(dir string, name string, fset *token.FileSet) (*fileInfo, error)

goBuildConstraint method #

func (sf *sourceFile) goBuildConstraint() string

goodOSArchFile method #

goodOSArchFile returns false if the name contains a $GOOS or $GOARCH suffix which does not match the current system. The recognized name formats are: name_$(GOOS).* name_$(GOARCH).* name_$(GOOS)_$(GOARCH).* name_$(GOOS)_test.* name_$(GOARCH)_test.* name_$(GOOS)_$(GOARCH)_test.* Exceptions: if GOOS=android, then files with GOOS=linux are also matched. if GOOS=illumos, then files with GOOS=solaris are also matched. if GOOS=ios, then files with GOOS=darwin are also matched.

func (ctxt *Context) goodOSArchFile(name string, allTags map[string]bool) bool

gopath method #

gopath returns the list of Go path directories.

func (ctxt *Context) gopath() []string

hasSubdir function #

hasSubdir reports if dir is within root by performing lexical analysis only.

func hasSubdir(root string, dir string) (rel string, ok bool)

hasSubdir method #

hasSubdir calls ctxt.HasSubdir (if not nil) or else uses the local file system to answer the question.

func (ctxt *Context) hasSubdir(root string, dir string) (rel string, ok bool)

ignoreFile method #

func (sf *sourceFile) ignoreFile() bool

importRaw function #

importRaw fills the rawPackage from the package files in srcDir. dir is the package's path relative to the modroot.

func importRaw(modroot string, reldir string) *rawPackage

imports method #

func (sf *sourceFile) imports() []rawImport

importsOffset method #

func (sf *sourceFile) importsOffset() int

indexModule function #

indexModule indexes the module at the given directory and returns its encoded representation. It returns ErrNotIndexed if the module can't be indexed because it contains symlinks.

func indexModule(modroot string) ([]byte, error)

indexPackage function #

indexPackage indexes the package at the given directory and returns its encoded representation. It returns ErrNotIndexed if the package can't be indexed.

func indexPackage(modroot string, pkgdir string) []byte

int method #

int reads the next int.

func (r *reader) int() int

intAt method #

intAt returns the int at the given offset in d.data.

func (d *decoder) intAt(off int) int

isAbsPath method #

isAbsPath calls ctxt.IsAbsPath (if not nil) or else filepath.IsAbs.

func (ctxt *Context) isAbsPath(path string) bool

isDir function #

isDir calls ctxt.IsDir (if not nil) or else uses fsys.Stat.

func isDir(path string) bool

isGoBuildComment function #

func isGoBuildComment(line []byte) bool

isIdent function #

func isIdent(c byte) bool

joinPath method #

joinPath calls ctxt.JoinPath (if not nil) or else filepath.Join.

func (ctxt *Context) joinPath(elem ...string) string

keys function #

func keys(m map[string]bool) []string

makePathsAbsolute method #

makePathsAbsolute looks for compiler options that take paths and makes them absolute. We do this because through the 1.8 release we ran the compiler in the package directory, so any relative -I or -L options would be relative to that directory. In 1.9 we changed to running the compiler in the build directory, to get consistent build results (issue #19964). To keep builds working, we change any relative -I or -L options to be absolute. Using filepath.IsAbs and filepath.Join here means the results will be different on different systems, but that's OK: -I and -L options are inherently system-dependent.

func (ctxt *Context) makePathsAbsolute(args []string, srcDir string)

matchAuto method #

matchAuto interprets text as either a +build or //go:build expression (whichever works), reporting whether the expression matches the build context. matchAuto is only used for testing of tag evaluation and in #cgo lines, which accept either syntax.

func (ctxt *Context) matchAuto(text string, allTags map[string]bool) bool

matchTag method #

matchTag reports whether the name is one of: cgo (if cgo is enabled) $GOOS $GOARCH boringcrypto ctxt.Compiler linux (if GOOS == android) solaris (if GOOS == illumos) tag (if tag is listed in ctxt.BuildTags or ctxt.ReleaseTags) It records all consulted tags in allTags.

func (ctxt *Context) matchTag(name string, allTags map[string]bool) bool

moduleHash function #

moduleHash returns an ActionID corresponding to the state of the module located at filesystem path modroot.

func moduleHash(modroot string, ismodcache bool) (cache.ActionID, error)

moduleWalkErr function #

moduleWalkErr returns filepath.SkipDir if the directory isn't relevant when indexing a module or generating a filehash, ErrNotIndexed, if the module shouldn't be indexed, and nil otherwise.

func moduleWalkErr(root string, path string, d fs.DirEntry, err error) error

name method #

func (sf *sourceFile) name() string

nameExt function #

func nameExt(name string) string

newEncoder function #

func newEncoder() *encoder

newImportReader function #

func newImportReader(name string, r io.Reader) *importReader

nextByte method #

nextByte is like peekByte but advances beyond the returned byte.

func (r *importReader) nextByte(skipSpace bool) byte

openIndexModule function #

openIndexModule returns the module index for modPath. It will return ErrNotIndexed if the module can not be read using the index because it contains symlinks.

func openIndexModule(modroot string, ismodcache bool) (*Module, error)

openIndexPackage function #

func openIndexPackage(modroot string, pkgdir string) (*IndexPackage, error)

packageFromBytes function #

packageFromBytes returns a *IndexPackage given the encoded representation.

func packageFromBytes(modroot string, data []byte) (p *IndexPackage, err error)

parseError method #

func (sf *sourceFile) parseError() string

parseErrorFromString function #

parseErrorFromString converts a string produced by parseErrorToString back to an error. An empty string is converted to a nil error, and all other strings are expected to be JSON-marshaled parseError structs. The two functions are meant to preserve the structure of an error of type scanner.ErrorList in a round trip, but may not preserve the structure of other errors.

func parseErrorFromString(s string) error

parseErrorToString function #

parseErrorToString converts the error from parsing the file into a string representation. A nil error is converted to an empty string, and all other errors are converted to a JSON-marshaled parseError struct, with ErrorList set for errors of type scanner.ErrorList, and ErrorString set to the error's string representation for all other errors.

func parseErrorToString(err error) string

parseFileHeader function #

func parseFileHeader(content []byte) (trimmed []byte, goBuild []byte, sawBinaryOnly bool, err error)

parseGoEmbed function #

parseGoEmbed parses the text following "//go:embed" to extract the glob patterns. It accepts unquoted space-separated patterns as well as double-quoted and back-quoted Go strings. This is based on a similar function in cmd/compile/internal/gc/noder.go; this version calculates position information as well.

func parseGoEmbed(args string, pos token.Position) ([]fileEmbed, error)

parseWord function #

parseWord skips any leading spaces or comments in data and then parses the beginning of data as an identifier or keyword, returning that word and what remains after the word.

func parseWord(data []byte) (word []byte, rest []byte)

peekByte method #

peekByte returns the next byte from the input reader but does not advance beyond it. If skipSpace is set, peekByte skips leading spaces and comments.

func (r *importReader) peekByte(skipSpace bool) byte

pkg method #

pkg returns the i'th IndexPackage in m.

func (m *Module) pkg(i int) *IndexPackage

pkgDir method #

pkgDir returns the dir string of the i'th package in the index.

func (m *Module) pkgDir(i int) string

pkgName method #

func (sf *sourceFile) pkgName() string

pkgOff method #

pkgOff returns the offset of the data for the i'th package in the index.

func (m *Module) pkgOff(i int) int

plusBuildConstraints method #

func (sf *sourceFile) plusBuildConstraints() []string

protect function #

protect marks the start of a large section of code that accesses the index. It should be used as: defer unprotect(protect, &err) It should not be used for trivial accesses which would be dwarfed by the overhead of the defer.

func protect() bool

readAt method #

readAt returns a reader starting at the given position in d.

func (d *decoder) readAt(pos int) *reader

readByte method #

readByte reads the next byte from the input, saves it in buf, and returns it. If an error occurs, readByte records the error in r.err and returns 0.

func (r *importReader) readByte() byte

readByteNoBuf method #

readByteNoBuf is like readByte but doesn't buffer the byte. It exhausts r.buf before reading from r.b.

func (r *importReader) readByteNoBuf() byte

readComments function #

readComments is like io.ReadAll, except that it only reads the leading block of comments in the file.

func readComments(f io.Reader) ([]byte, error)

readGoInfo function #

readGoInfo expects a Go file as input and reads the file up to and including the import section. It records what it learned in *info. If info.fset is non-nil, readGoInfo parses the file and sets info.parsed, info.parseErr, info.imports and info.embeds. It only returns an error if there are problems reading the file, not for syntax errors in the file itself.

func readGoInfo(f io.Reader, info *fileInfo) error

readIdent method #

readIdent reads an identifier from the input. If an identifier is not present, readIdent records a syntax error.

func (r *importReader) readIdent()

readImport method #

readImport reads an import clause - optional identifier followed by quoted string - from the input.

func (r *importReader) readImport()

readKeyword method #

readKeyword reads the given keyword from the input. If the keyword is not present, readKeyword records a syntax error.

func (r *importReader) readKeyword(kw string)

readString method #

readString reads a quoted string literal from the input. If an identifier is not present, readString records a syntax error.

func (r *importReader) readString()

relPath function #

relPath returns the path relative to the module's root.

func relPath(path string, modroot string) string

safeCgoName function #

func safeCgoName(s string) bool

saveCgo method #

saveCgo saves the information from the #cgo lines in the import "C" comment. These lines set CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS and pkg-config directives that affect the way cgo's C code is built.

func (ctxt *Context) saveCgo(filename string, di *build.Package, text string) error

shouldBuild function #

implements imports.ShouldBuild in terms of an index sourcefile.

func shouldBuild(sf *sourceFile, tags map[string]bool) bool

skipSpaceOrComment function #

skipSpaceOrComment returns data with any leading spaces or comments removed.

func skipSpaceOrComment(data []byte) []byte

splitPathList method #

splitPathList calls ctxt.SplitPathList (if not nil) or else filepath.SplitList.

func (ctxt *Context) splitPathList(s string) []string

splitQuoted function #

splitQuoted splits the string s around each instance of one or more consecutive white space characters while taking into account quotes and escaping, and returns an array of substrings of s or an empty list if s contains only white space. Single quotes and double quotes are recognized to prevent splitting within the quoted region, and are removed from the resulting substrings. If a quote in s isn't closed err will be set and r will have the unclosed argument as the last element. The backslash is used for escaping. For example, the following string: a b:"c d" 'e''f' "g\"" Would be parsed as: []string{"a", "b:c d", "ef", `g"`}

func splitQuoted(s string) (r []string, err error)

string method #

string reads the next string.

func (r *reader) string() string

stringAt method #

stringAt returns the string pointed at by the int at the given offset in d.data.

func (d *decoder) stringAt(off int) string

stringTableAt method #

stringTableAt returns the string at the given offset in the string table d.str.

func (d *decoder) stringTableAt(off int) string

synopsis method #

func (sf *sourceFile) synopsis() string

syntaxError method #

syntaxError records a syntax error, but only if an I/O error has not already been recorded.

func (r *importReader) syntaxError()

tokpos method #

tokpos reads the next token.Position.

func (r *reader) tokpos() token.Position

unprotect function #

unprotect marks the end of a large section of code that accesses the index. It should be used as: defer unprotect(protect, &err) end looks for panics due to errCorrupt or bad mmap accesses. When it finds them, it adds explanatory text, consumes the panic, and sets *errp instead. If errp is nil, end adds the explanatory text but then calls base.Fatalf.

func unprotect(old bool, errp *error)

Generated with Arrow