14pkg math/big, const MaxBase = 36
15pkg math/big, type Word uintptr
16▶pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
17pkg os (linux-arm), const O_SYNC = 1052672
18pkg os (linux-arm), const O_SYNC = 4096
· · ·
36pkg os, const ModeType = 2399666176
37pkg os, const ModeType FileMode
38▶pkg os, func Chmod(string, FileMode) error
39pkg os, func Lstat(string) (FileInfo, error)
40pkg os, func Mkdir(string, FileMode) error
· · ·
39▶pkg os, func Lstat(string) (FileInfo, error)
40pkg os, func Mkdir(string, FileMode) error
41pkg os, func MkdirAll(string, FileMode) error
· · ·
40▶pkg os, func Mkdir(string, FileMode) error
41pkg os, func MkdirAll(string, FileMode) error
42pkg os, func OpenFile(string, int, FileMode) (*File, error)
· · ·
41▶pkg os, func MkdirAll(string, FileMode) error
42pkg os, func OpenFile(string, int, FileMode) (*File, error)
43pkg os, func SameFile(FileInfo, FileInfo) bool
+ 22 more matches in this file
30pkg crypto/x509, const UnconstrainedName = 7
31pkg crypto/x509, const UnconstrainedName InvalidReason
32▶pkg crypto/x509, func MarshalPKCS1PublicKey(*rsa.PublicKey) []uint8
33pkg crypto/x509, func MarshalPKCS8PrivateKey(interface{}) ([]uint8, error)
34pkg crypto/x509, func ParsePKCS1PublicKey([]uint8) (*rsa.PublicKey, error)
· · ·
33▶pkg crypto/x509, func MarshalPKCS8PrivateKey(interface{}) ([]uint8, error)
34pkg crypto/x509, func ParsePKCS1PublicKey([]uint8) (*rsa.PublicKey, error)
35pkg crypto/x509, method (PublicKeyAlgorithm) String() string
· · ·
34▶pkg crypto/x509, func ParsePKCS1PublicKey([]uint8) (*rsa.PublicKey, error)
35pkg crypto/x509, method (PublicKeyAlgorithm) String() string
36pkg crypto/x509, type Certificate struct, ExcludedEmailAddresses []string
· · ·
37pkg crypto/x509, type Certificate struct, ExcludedIPRanges []*net.IPNet
38▶pkg crypto/x509, type Certificate struct, ExcludedURIDomains []string
39pkg crypto/x509, type Certificate struct, PermittedEmailAddresses []string
40pkg crypto/x509, type Certificate struct, PermittedIPRanges []*net.IPNet
· · ·
41▶pkg crypto/x509, type Certificate struct, PermittedURIDomains []string
42pkg crypto/x509, type Certificate struct, URIs []*url.URL
43pkg crypto/x509, type CertificateInvalidError struct, Detail string
+ 15 more matches in this file
1▶pkg bytes, func ReplaceAll([]uint8, []uint8, []uint8) []uint8
2pkg crypto/tls, const TLS_AES_128_GCM_SHA256 = 4865
3pkg crypto/tls, const TLS_AES_128_GCM_SHA256 uint16
· · ·
16pkg go/doc, const PreserveAST = 4
17pkg go/doc, const PreserveAST Mode
18▶pkg go/importer, func ForCompiler(*token.FileSet, string, Lookup) types.Importer
19pkg go/token, method (*File) LineStart(int) Pos
20pkg io, type StringWriter interface { WriteString }
· · ·
21pkg io, type StringWriter interface, WriteString(string) (int, error)
22pkg log, method (*Logger) Writer() io.Writer
23▶pkg math/bits, func Add(uint, uint, uint) (uint, uint)
24pkg math/bits, func Add32(uint32, uint32, uint32) (uint32, uint32)
25pkg math/bits, func Add64(uint64, uint64, uint64) (uint64, uint64)
· · ·
24▶pkg math/bits, func Add32(uint32, uint32, uint32) (uint32, uint32)
25pkg math/bits, func Add64(uint64, uint64, uint64) (uint64, uint64)
26pkg math/bits, func Div(uint, uint, uint) (uint, uint)
· · ·
25▶pkg math/bits, func Add64(uint64, uint64, uint64) (uint64, uint64)
26pkg math/bits, func Div(uint, uint, uint) (uint, uint)
27pkg math/bits, func Div32(uint32, uint32, uint32) (uint32, uint32)
+ 27 more matches in this file
1▶pkg bytes, func ToValidUTF8([]uint8, []uint8) []uint8
2pkg crypto/ed25519, const PrivateKeySize = 64
3pkg crypto/ed25519, const PrivateKeySize ideal-int
· · ·
8pkg crypto/ed25519, const SignatureSize = 64
9pkg crypto/ed25519, const SignatureSize ideal-int
10▶pkg crypto/ed25519, func GenerateKey(io.Reader) (PublicKey, PrivateKey, error)
11pkg crypto/ed25519, func NewKeyFromSeed([]uint8) PrivateKey
12pkg crypto/ed25519, func Sign(PrivateKey, []uint8) []uint8
· · ·
11▶pkg crypto/ed25519, func NewKeyFromSeed([]uint8) PrivateKey
12pkg crypto/ed25519, func Sign(PrivateKey, []uint8) []uint8
13pkg crypto/ed25519, func Verify(PublicKey, []uint8, []uint8) bool
· · ·
12▶pkg crypto/ed25519, func Sign(PrivateKey, []uint8) []uint8
13pkg crypto/ed25519, func Verify(PublicKey, []uint8, []uint8) bool
14pkg crypto/ed25519, method (PrivateKey) Public() crypto.PublicKey
· · ·
13▶pkg crypto/ed25519, func Verify(PublicKey, []uint8, []uint8) bool
14pkg crypto/ed25519, method (PrivateKey) Public() crypto.PublicKey
15pkg crypto/ed25519, method (PrivateKey) Seed() []uint8
+ 305 more matches in this file
3pkg crypto/tls, const TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 52392
4pkg crypto/tls, const TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 uint16
5▶pkg crypto/tls, func CipherSuiteName(uint16) string
6pkg crypto/tls, func CipherSuites() []*CipherSuite
7pkg crypto/tls, func InsecureCipherSuites() []*CipherSuite
· · ·
6▶pkg crypto/tls, func CipherSuites() []*CipherSuite
7pkg crypto/tls, func InsecureCipherSuites() []*CipherSuite
8pkg crypto/tls, method (*CertificateRequestInfo) SupportsCertificate(*Certificate) error
· · ·
7▶pkg crypto/tls, func InsecureCipherSuites() []*CipherSuite
8pkg crypto/tls, method (*CertificateRequestInfo) SupportsCertificate(*Certificate) error
9pkg crypto/tls, method (*ClientHelloInfo) SupportsCertificate(*Certificate) error
· · ·
79pkg debug/dwarf, const AttrMacros = 121
80pkg debug/dwarf, const AttrMacros Attr
81▶pkg debug/dwarf, const AttrMainSubprogram = 106
82pkg debug/dwarf, const AttrMainSubprogram Attr
83pkg debug/dwarf, const AttrMutable = 97
· · ·
82▶pkg debug/dwarf, const AttrMainSubprogram Attr
83pkg debug/dwarf, const AttrMutable = 97
84pkg debug/dwarf, const AttrMutable Attr
+ 355 more matches in this file
1pkg bufio, method (*Writer) AvailableBuffer() []uint8
2pkg bufio, method (ReadWriter) AvailableBuffer() []uint8
3▶pkg bytes, func Cut([]uint8, []uint8) ([]uint8, []uint8, bool)
4pkg bytes, func Title //deprecated
5pkg crypto/tls, method (*Conn) NetConn() net.Conn
· · ·
4▶pkg bytes, func Title //deprecated
5pkg crypto/tls, method (*Conn) NetConn() net.Conn
6pkg crypto/tls, type Config struct, PreferServerCipherSuites //deprecated
· · ·
7pkg crypto/x509, method (*CertPool) Subjects //deprecated
8▶pkg debug/buildinfo, func Read(io.ReaderAt) (*debug.BuildInfo, error)
9pkg debug/buildinfo, func ReadFile(string) (*debug.BuildInfo, error)
10pkg debug/buildinfo, type BuildInfo = debug.BuildInfo
· · ·
9▶pkg debug/buildinfo, func ReadFile(string) (*debug.BuildInfo, error)
10pkg debug/buildinfo, type BuildInfo = debug.BuildInfo
11pkg debug/dwarf, type BasicType struct, DataBitOffset int64
· · ·
16pkg go/ast, method (*IndexListExpr) End() token.Pos
17pkg go/ast, method (*IndexListExpr) Pos() token.Pos
18▶pkg go/ast, type FuncType struct, TypeParams *FieldList
19pkg go/ast, type IndexListExpr struct
20pkg go/ast, type IndexListExpr struct, Indices []Expr
+ 47 more matches in this file
1▶pkg archive/zip, func RegisterCompressor(uint16, Compressor)
2pkg archive/zip, func RegisterDecompressor(uint16, Decompressor)
3pkg archive/zip, method (*File) DataOffset() (int64, error)
· · ·
2▶pkg archive/zip, func RegisterDecompressor(uint16, Decompressor)
3pkg archive/zip, method (*File) DataOffset() (int64, error)
4pkg archive/zip, type Compressor func(io.Writer) (io.WriteCloser, error)
· · ·
4▶pkg archive/zip, type Compressor func(io.Writer) (io.WriteCloser, error)
5pkg archive/zip, type Decompressor func(io.Reader) io.ReadCloser
6pkg bufio, method (*Reader) Reset(io.Reader)
· · ·
5▶pkg archive/zip, type Decompressor func(io.Reader) io.ReadCloser
6pkg bufio, method (*Reader) Reset(io.Reader)
7pkg bufio, method (*Writer) Reset(io.Writer)
· · ·
9pkg compress/gzip, method (*Writer) Reset(io.Writer)
10pkg compress/zlib, method (*Writer) Reset(io.Writer)
11▶pkg container/heap, func Fix(Interface, int)
12pkg container/list, method (*List) MoveAfter(*Element, *Element)
13pkg container/list, method (*List) MoveBefore(*Element, *Element)
+ 1,151 more matches in this file
1▶pkg bytes, func FieldsFuncSeq([]uint8, func(int32) bool) iter.Seq[[]uint8] #61901
2pkg bytes, func FieldsSeq([]uint8) iter.Seq[[]uint8] #61901
3pkg bytes, func Lines([]uint8) iter.Seq[[]uint8] #61901
· · ·
2▶pkg bytes, func FieldsSeq([]uint8) iter.Seq[[]uint8] #61901
3pkg bytes, func Lines([]uint8) iter.Seq[[]uint8] #61901
4pkg bytes, func SplitAfterSeq([]uint8, []uint8) iter.Seq[[]uint8] #61901
· · ·
3▶pkg bytes, func Lines([]uint8) iter.Seq[[]uint8] #61901
4pkg bytes, func SplitAfterSeq([]uint8, []uint8) iter.Seq[[]uint8] #61901
5pkg bytes, func SplitSeq([]uint8, []uint8) iter.Seq[[]uint8] #61901
· · ·
4▶pkg bytes, func SplitAfterSeq([]uint8, []uint8) iter.Seq[[]uint8] #61901
5pkg bytes, func SplitSeq([]uint8, []uint8) iter.Seq[[]uint8] #61901
6pkg crypto/cipher, func NewCFBDecrypter //deprecated #69445
· · ·
5▶pkg bytes, func SplitSeq([]uint8, []uint8) iter.Seq[[]uint8] #61901
6pkg crypto/cipher, func NewCFBDecrypter //deprecated #69445
7pkg crypto/cipher, func NewCFBEncrypter //deprecated #69445
+ 49 more matches in this file
11pkg compress/gzip, method (*Reader) Multistream(bool)
12
13▶# CL 138800043 crypto: Add SHA3 functions in go.crypto/sha3 to the Hash enum., David Leon Gil <coruus@gmail.com>
14pkg crypto, const SHA3_224 = 10
15pkg crypto, const SHA3_224 Hash
· · ·
22
23# CL 114680043 crypto: add Signer, Adam Langley <agl@golang.org>
24▶pkg crypto, method (Hash) HashFunc() Hash
25pkg crypto, type Signer interface { Public, Sign }
26pkg crypto, type Signer interface, Public() PublicKey
· · ·
27pkg crypto, type Signer interface, Sign(io.Reader, []uint8, SignerOpts) ([]uint8, error)
28▶pkg crypto, type SignerOpts interface { HashFunc }
29pkg crypto, type SignerOpts interface, HashFunc() Hash
30pkg crypto/ecdsa, method (*PrivateKey) Public() crypto.PublicKey
· · ·
29▶pkg crypto, type SignerOpts interface, HashFunc() Hash
30pkg crypto/ecdsa, method (*PrivateKey) Public() crypto.PublicKey
31pkg crypto/ecdsa, method (*PrivateKey) Sign(io.Reader, []uint8, crypto.SignerOpts) ([]uint8, error)
· · ·
32▶pkg crypto/rsa, method (*PSSOptions) HashFunc() crypto.Hash
33pkg crypto/rsa, method (*PrivateKey) Public() crypto.PublicKey
34pkg crypto/rsa, method (*PrivateKey) Sign(io.Reader, []uint8, crypto.SignerOpts) ([]uint8, error)
+ 29 more matches in this file
44pkg crypto/tls, type ClientHelloInfo struct, SupportedProtos []string
45pkg crypto/tls, type ClientHelloInfo struct, SupportedVersions []uint16
46▶pkg crypto/tls, type Config struct, GetClientCertificate func(*CertificateRequestInfo) (*Certificate, error)
47pkg crypto/tls, type Config struct, GetConfigForClient func(*ClientHelloInfo) (*Config, error)
48pkg crypto/tls, type Config struct, KeyLogWriter io.Writer
· · ·
47▶pkg crypto/tls, type Config struct, GetConfigForClient func(*ClientHelloInfo) (*Config, error)
48pkg crypto/tls, type Config struct, KeyLogWriter io.Writer
49pkg crypto/tls, type Config struct, VerifyPeerCertificate func([][]uint8, [][]*x509.Certificate) error
· · ·
49▶pkg crypto/tls, type Config struct, VerifyPeerCertificate func([][]uint8, [][]*x509.Certificate) error
50pkg crypto/tls, type SignatureScheme uint16
51pkg crypto/x509, const NameMismatch = 5
· · ·
127pkg database/sql/driver, type TxOptions struct, Isolation IsolationLevel
128pkg database/sql/driver, type TxOptions struct, ReadOnly bool
129▶pkg database/sql, func Named(string, interface{}) NamedArg
130pkg database/sql, method (*ColumnType) DatabaseTypeName() string
131pkg database/sql, method (*ColumnType) DecimalSize() (int64, int64, bool)
· · ·
172pkg encoding/json, type UnmarshalTypeError struct, Field string
173pkg encoding/json, type UnmarshalTypeError struct, Struct string
174▶pkg expvar, func Handler() http.Handler
175pkg expvar, method (*Float) Value() float64
176pkg expvar, method (Func) Value() interface{}
+ 25 more matches in this file
7pkg crypto, const BLAKE2s_256 = 16
8pkg crypto, const BLAKE2s_256 Hash
9▶pkg crypto/x509, type Certificate struct, ExcludedDNSDomains []string
10pkg database/sql, method (*Conn) BeginTx(context.Context, *TxOptions) (*Tx, error)
11pkg database/sql, method (*Conn) Close() error
· · ·
34pkg encoding/base32, method (Encoding) WithPadding(int32) *Encoding
35pkg encoding/csv, type Reader struct, ReuseRecord bool
36▶pkg encoding/json, func Valid([]uint8) bool
37pkg go/ast, type TypeSpec struct, Assign token.Pos
38pkg go/types, func SizesFor(string, string) Sizes
· · ·
38▶pkg go/types, func SizesFor(string, string) Sizes
39pkg go/types, method (*TypeName) IsAlias() bool
40pkg hash/fnv, func New128() hash.Hash
· · ·
40▶pkg hash/fnv, func New128() hash.Hash
41pkg hash/fnv, func New128a() hash.Hash
42pkg html/template, const ErrPredefinedEscaper = 11
· · ·
41▶pkg hash/fnv, func New128a() hash.Hash
42pkg html/template, const ErrPredefinedEscaper = 11
43pkg html/template, const ErrPredefinedEscaper ErrorCode
+ 55 more matches in this file
10pkg archive/tar, const TypeXGlobalHeader ideal-char
11pkg archive/tar, const TypeXHeader ideal-char
12▶pkg archive/tar, func NewReader(io.Reader) *Reader
13pkg archive/tar, func NewWriter(io.Writer) *Writer
14pkg archive/tar, method (*Reader) Next() (*Header, error)
· · ·
13▶pkg archive/tar, func NewWriter(io.Writer) *Writer
14pkg archive/tar, method (*Reader) Next() (*Header, error)
15pkg archive/tar, method (*Reader) Read([]uint8) (int, error)
· · ·
41pkg archive/zip, const Deflate uint16
42pkg archive/zip, const Store uint16
43▶pkg archive/zip, func FileInfoHeader(os.FileInfo) (*FileHeader, error)
44pkg archive/zip, func NewReader(io.ReaderAt, int64) (*Reader, error)
45pkg archive/zip, func NewWriter(io.Writer) *Writer
· · ·
44▶pkg archive/zip, func NewReader(io.ReaderAt, int64) (*Reader, error)
45pkg archive/zip, func NewWriter(io.Writer) *Writer
46pkg archive/zip, func OpenReader(string) (*ReadCloser, error)
· · ·
45▶pkg archive/zip, func NewWriter(io.Writer) *Writer
46pkg archive/zip, func OpenReader(string) (*ReadCloser, error)
47pkg archive/zip, method (*File) FileInfo() os.FileInfo
+ 1,863 more matches in this file
52<pre>
53$ cat x.go
54▶package main
55
56func main() {
· · ·
56▶func main() {
57 println(3)
58}
· · ·
59$ GOOS=linux GOARCH=amd64 go tool compile -S x.go # or: go build -gcflags -S x.go
60▶"".main STEXT size=74 args=0x0 locals=0x10
61 0x0000 00000 (x.go:3) TEXT "".main(SB), $16-0
62 0x0000 00000 (x.go:3) MOVQ (TLS), CX
· · ·
61▶ 0x0000 00000 (x.go:3) TEXT "".main(SB), $16-0
62 0x0000 00000 (x.go:3) MOVQ (TLS), CX
63 0x0009 00009 (x.go:3) CMPQ SP, 16(CX)
· · ·
66 0x0013 00019 (x.go:3) MOVQ BP, 8(SP)
67 0x0018 00024 (x.go:3) LEAQ 8(SP), BP
68▶ 0x001d 00029 (x.go:3) FUNCDATA $0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
69 0x001d 00029 (x.go:3) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
70 0x001d 00029 (x.go:3) FUNCDATA $2, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
+ 51 more matches in this file
294<p class="rule">
295If a package <code>p</code> imports package <code>q</code>, the completion of
296▶<code>q</code>'s <code>init</code> functions happens before the start of any of <code>p</code>'s.
297</p>
298
· · ·
299<p class="rule">
300▶The completion of all <code>init</code> functions is synchronized before
301the start of the function <code>main.main</code>.
302</p>
· · ·
301▶the start of the function <code>main.main</code>.
302</p>
303
· · ·
316var a string
317
318▶func f() {
319 print(a)
320}
· · ·
321
322▶func hello() {
323 a = "hello, world"
324 go f()
+ 38 more matches in this file
259</p>
260<pre class="grammar">
261▶break default func interface select
262case defer go map struct
263chan else goto package switch
· · ·
653a <a href="#Constant_expressions">constant expression</a>,
654a <a href="#Conversions">conversion</a> with a result that is a constant, or
655▶the result value of some built-in functions such as
656<code>min</code> or <code>max</code> applied to constant arguments,
657<code>unsafe.Sizeof</code> applied to <a href="#Package_unsafe">certain values</a>,
· · ·
749<p>
750A <a href="#Variable_declarations">variable declaration</a>
751▶or, for function parameters and results, the signature
752of a <a href="#Function_declarations">function declaration</a>
753or <a href="#Function_literals">function literal</a> reserves
· · ·
752▶of a <a href="#Function_declarations">function declaration</a>
753or <a href="#Function_literals">function literal</a> reserves
754storage for a named variable.
· · ·
753▶or <a href="#Function_literals">function literal</a> reserves
754storage for a named variable.
755
+ 462 more matches in this file
16// external zip tool is used or the ordering of file names in a directory
17// or the current time.
18▶package main
19
20import (
· · ·
31)
32
33▶func usage() {
34 fmt.Fprintf(os.Stderr, "usage: go run mkzip.go zoneinfo.zip\n")
35 os.Exit(2)
· · ·
36}
37
38▶func main() {
39 log.SetPrefix("mkzip: ")
40 log.SetFlags(0)
· · ·
49 zw := zip.NewWriter(&zb)
50 seen := make(map[string]bool)
51▶ err := filepath.WalkDir(".", func(path string, d fs.DirEntry, err error) error {
52 if d.IsDir() {
53 return nil
10// and foreign code on multiple pthreads.
11
12▶package main
13
14import (
· · ·
17)
18
19▶func fibber(c chan *big.Int, out chan string, n int64) {
20 // Keep the fibbers in dedicated operating system
21 // threads, so that this program tests coordination
· · ·
35}
36
37▶func main() {
38 c := make(chan *big.Int)
39 out := make(chan string)
5//go:build ignore
6
7▶package main
8
9import (
· · ·
22)
23
24▶func extractDigit() int64 {
25 if big.CmpInt(numer, accum) > 0 {
26 return -1
· · ·
35}
36
37▶func nextTerm(k int64) {
38 y2 := k*2 + 1
39 accum.Add(accum, tmp1.Lsh(numer, 1))
· · ·
43}
44
45▶func eliminateDigit(d int64) {
46 accum.Sub(accum, tmp1.Mul(denom, tmp1.SetInt64(d)))
47 accum.Mul(accum, ten)
· · ·
49}
50
51▶func main() {
52 i := 0
53 k := int64(0)
5//go:build !(windows || js || wasip1)
6
7▶package main
8
9import (
· · ·
13)
14
15▶func TestExitCodeFilter(t *testing.T) {
16 // Write text to the filter one character at a time.
17 var out strings.Builder
· · ·
46}
47
48▶func TestExitCodeMissing(t *testing.T) {
49 var wantErr *regexp.Regexp
50 check := func(text string) {
· · ·
50▶ check := func(text string) {
51 t.Helper()
52 var out strings.Builder
11// This program can be used as go_android_GOARCH_exec by the Go tool.
12// It executes binaries on an android device using adb.
13▶package main
14
15import (
· · ·
32)
33
34▶func adbRun(args string) (int, error) {
35 // The exit code of adb is often wrong. In theory it was fixed in 2016
36 // (https://code.google.com/p/android/issues/detail?id=3254), but it's
· · ·
63}
64
65▶func adb(args ...string) error {
66 if out, err := adbCmd(args...).CombinedOutput(); err != nil {
67 fmt.Fprintf(os.Stderr, "adb %s\n%s", strings.Join(args, " "), out)
· · ·
71}
72
73▶func adbCmd(args ...string) *exec.Cmd {
74 if flags := os.Getenv("GOANDROID_ADB_FLAGS"); flags != "" {
75 args = append(strings.Split(flags, " "), args...)
· · ·
83)
84
85▶func main() {
86 log.SetFlags(0)
87 log.SetPrefix("go_android_exec: ")
+ 13 more matches in this file
11// be obtained by following the instructions at
12// https://github.com/libimobiledevice/libimobiledevice.
13▶package main
14
15import (
· · ·
22)
23
24▶func main() {
25 udids := getLines(exec.Command("idevice_id", "-l"))
26 if len(udids) == 0 {
· · ·
64}
65
66▶func detectMobileProvisionFiles(udids [][]byte) []string {
67 cmd := exec.Command("mdfind", "-name", ".mobileprovision")
68 lines := getLines(cmd)
· · ·
89}
90
91▶func parseMobileProvision(fname string) *exec.Cmd {
92 return exec.Command("security", "cms", "-D", "-i", string(fname))
93}
· · ·
94
95▶func plistExtract(fname string, path string) ([]byte, error) {
96 out, err := exec.Command("/usr/libexec/PlistBuddy", "-c", "Print "+path, fname).CombinedOutput()
97 if err != nil {
+ 4 more matches in this file
5// This program can be used as go_ios_$GOARCH_exec by the Go tool. It executes
6// binaries on the iOS Simulator using the XCode toolchain.
7▶package main
8
9import (
· · ·
36var lock *os.File
37
38▶func main() {
39 log.SetFlags(0)
40 log.SetPrefix("go_ios_exec: ")
· · ·
49 bundleID = "golang.gotest"
50
51▶ exitCode, err := runMain()
52 if err != nil {
53 log.Fatalf("%v\n", err)
· · ·
56}
57
58▶func runMain() (int, error) {
59 var err error
60 tmpdir, err = os.MkdirTemp("", "go_ios_exec_")
· · ·
95}
96
97▶func runOnSimulator(appdir string) error {
98 if err := installSimulator(appdir); err != nil {
99 return err
+ 9 more matches in this file
45type headerError []string
46
47▶func (he headerError) Error() string {
48 const prefix = "archive/tar: cannot encode header"
49 var ss []string
· · ·
214type sparseEntry struct{ Offset, Length int64 }
215
216▶func (s sparseEntry) endOffset() int64 { return s.Offset + s.Length }
217
218// A sparse file can be represented as either a sparseDatas or a sparseHoles.
· · ·
255// validateSparseEntries reports whether sp is a valid sparse map.
256// It does not matter whether sp represents data fragments or hole fragments.
257▶func validateSparseEntries(sp []sparseEntry, size int64) bool {
258 // Validate all sparse entries. These are the same checks as performed by
259 // the BSD tar utility.
· · ·
285// with arbitrary offsets and lengths, the GNU tar utility can only handle
286// offsets and lengths that are multiples of blockSize.
287▶func alignSparseEntries(src []sparseEntry, size int64) []sparseEntry {
288 dst := src[:0]
289 for _, s := range src {
· · ·
304// The input must have been already validated.
305//
306▶// This function mutates src and returns a normalized map where:
307// - adjacent fragments are coalesced together
308// - only the last fragment may be empty
+ 22 more matches in this file
37
38// NewReader creates a new [Reader] reading from r.
39▶func NewReader(r io.Reader) *Reader {
40 return &Reader{r: r, curr: ®FileReader{r, 0}}
41}
· · ·
43// Next advances to the next entry in the tar archive.
44// The Header.Size determines how many bytes can be read for the next file.
45▶// Any remaining data in the current file is automatically discarded.
46// At the end of the archive, Next returns the error io.EOF.
47//
· · ·
53// Programs that want to accept non-local names can ignore
54// the [ErrInsecurePath] error and use the returned header.
55▶func (tr *Reader) Next() (*Header, error) {
56 if tr.err != nil {
57 return nil, tr.err
· · ·
68}
69
70▶func (tr *Reader) next() (*Header, error) {
71 var paxHdrs map[string]string
72 var gnuLongName, gnuLongLink string
· · ·
79 format := FormatUSTAR | FormatPAX | FormatGNU
80 for {
81▶ // Discard the remainder of the file and any padding.
82 if err := discard(tr.r, tr.curr.physicalRemaining()); err != nil {
83 return nil, err
+ 48 more matches in this file
25)
26
27▶func TestReader(t *testing.T) {
28 vectors := []struct {
29 file string // Test input file
· · ·
633
634 for _, v := range vectors {
635▶ t.Run(strings.TrimSuffix(path.Base(v.file), ".base64"), func(t *testing.T) {
636 path := v.file
637 if v.obscured {
· · ·
712}
713
714▶func TestPartialRead(t *testing.T) {
715 type testCase struct {
716 cnt int // Number of bytes to read
· · ·
738
739 for _, v := range vectors {
740▶ t.Run(path.Base(v.file), func(t *testing.T) {
741 f, err := os.Open(v.file)
742 if err != nil {
· · ·
767}
768
769▶func TestUninitializedRead(t *testing.T) {
770 f, err := os.Open("testdata/gnu.tar")
771 if err != nil {
+ 56 more matches in this file