text
stringlengths
2
1.1M
id
stringlengths
11
117
metadata
dict
__index_level_0__
int64
0
885
// Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package cmp provides types and functions related to comparing // ordered values. package cmp // Ordered is a constraint that permits any ordered type: any t...
go/src/cmp/cmp.go/0
{ "file_path": "go/src/cmp/cmp.go", "repo_id": "go", "token_count": 711 }
200
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package flate import ( "errors" "fmt" "io" "math" ) const ( NoCompression = 0 BestSpeed = 1 BestCompression = 9 DefaultCompression = ...
go/src/compress/flate/deflate.go/0
{ "file_path": "go/src/compress/flate/deflate.go", "repo_id": "go", "token_count": 7988 }
201
//Copyright2009ThGoAuthor.Allrightrrvd. //UofthiourccodigovrndbyBSD-tyl //licnthtcnbfoundinthLICENSEfil. pckgmin import"o" funcmin(){ vrb=mk([]byt,65535) f,_:=o.Crt("huffmn-null-mx.in") f.Writ(b) } ABCDEFGHIJKLMNOPQRSTUVXxyz!"#¤%&/?"
go/src/compress/flate/testdata/huffman-text-shift.in/0
{ "file_path": "go/src/compress/flate/testdata/huffman-text-shift.in", "repo_id": "go", "token_count": 130 }
202
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ring import ( "fmt" "testing" ) // For debugging - keep around. func dump(r *Ring) { if r == nil { fmt.Println("empty") return } i, n := 0, r...
go/src/container/ring/ring_test.go/0
{ "file_path": "go/src/container/ring/ring_test.go", "repo_id": "go", "token_count": 2083 }
203
// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !purego package aes import ( "crypto/cipher" "crypto/internal/alias" ) // Assert that aesCipherAsm implements the cbcEncAble and cbcDecAble inte...
go/src/crypto/aes/cbc_s390x.go/0
{ "file_path": "go/src/crypto/aes/cbc_s390x.go", "repo_id": "go", "token_count": 653 }
204
// Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (goexperiment.boringcrypto && !boringcrypto) || (!goexperiment.boringcrypto && boringcrypto) package boring_test import "testing" func TestNotBori...
go/src/crypto/boring/notboring_test.go/0
{ "file_path": "go/src/crypto/boring/notboring_test.go", "repo_id": "go", "token_count": 130 }
205
// Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ecdh import ( "crypto/internal/edwards25519/field" "crypto/internal/randutil" "errors" "io" ) var ( x25519PublicKeySize = 32 x25519PrivateKey...
go/src/crypto/ecdh/x25519.go/0
{ "file_path": "go/src/crypto/ecdh/x25519.go", "repo_id": "go", "token_count": 1414 }
206
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !purego #include "textflag.h" // func addMulVVW1024(z, x *uint, y uint) (c uint) TEXT ·addMulVVW1024(SB), $0-16 MOVL $32, BX JMP addMulVVWx(SB) ...
go/src/crypto/internal/bigmod/nat_386.s/0
{ "file_path": "go/src/crypto/internal/bigmod/nat_386.s", "repo_id": "go", "token_count": 509 }
207
// Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package bcache import ( "fmt" "runtime" "sync" "sync/atomic" "testing" ) var registeredCache Cache[int, int32] func init() { registeredCache.Register()...
go/src/crypto/internal/boring/bcache/cache_test.go/0
{ "file_path": "go/src/crypto/internal/boring/bcache/cache_test.go", "repo_id": "go", "token_count": 1059 }
208
// Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build boringcrypto && linux && (amd64 || arm64) && !android && !msan package boring // #include "goboringcrypto.h" import "C" import "unsafe" type randR...
go/src/crypto/internal/boring/rand.go/0
{ "file_path": "go/src/crypto/internal/boring/rand.go", "repo_id": "go", "token_count": 240 }
209
// Copyright (c) 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package field implements fast arithmetic modulo 2^255-19. package field import ( "crypto/subtle" "errors" "internal/byteorder" "math/bits" ) // Ele...
go/src/crypto/internal/edwards25519/field/fe.go/0
{ "file_path": "go/src/crypto/internal/edwards25519/field/fe.go", "repo_id": "go", "token_count": 5650 }
210
// Copyright (c) 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package edwards25519 import ( "testing" "testing/quick" ) var ( // a random scalar generated using dalek. dalekScalar, _ = (&Scalar{}).SetCanonicalByt...
go/src/crypto/internal/edwards25519/scalarmult_test.go/0
{ "file_path": "go/src/crypto/internal/edwards25519/scalarmult_test.go", "repo_id": "go", "token_count": 2354 }
211
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !purego // This file contains constant-time, 64-bit assembly implementation of // P256. The optimizations performed here are described in detail in:...
go/src/crypto/internal/nistec/p256_asm_arm64.s/0
{ "file_path": "go/src/crypto/internal/nistec/p256_asm_arm64.s", "repo_id": "go", "token_count": 18204 }
212
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by go run gen.go -output md5block.go; DO NOT EDIT. package md5 import ( "internal/byteorder" "math/bits" ) func blockGeneric(dig *digest,...
go/src/crypto/md5/md5block.go/0
{ "file_path": "go/src/crypto/md5/md5block.go", "repo_id": "go", "token_count": 3082 }
213
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build js && wasm package rand import "syscall/js" // The maximum buffer size for crypto.getRandomValues is 65536 bytes. // https://developer.mozilla.org...
go/src/crypto/rand/rand_js.go/0
{ "file_path": "go/src/crypto/rand/rand_js.go", "repo_id": "go", "token_count": 374 }
214
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package rsa_test import ( "bytes" "crypto" "crypto/rand" . "crypto/rsa" "crypto/sha1" "crypto/sha256" "crypto/x509" "encoding/base64" "encoding/hex" ...
go/src/crypto/rsa/pkcs1v15_test.go/0
{ "file_path": "go/src/crypto/rsa/pkcs1v15_test.go", "repo_id": "go", "token_count": 4254 }
215
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // // ARM version of md5block.go //go:build !purego #include "textflag.h" // SHA-1 block routine. See sha1block.go for Go equivalent. // // There are 80 round...
go/src/crypto/sha1/sha1block_arm.s/0
{ "file_path": "go/src/crypto/sha1/sha1block_arm.s", "repo_id": "go", "token_count": 3029 }
216
// Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !purego #include "textflag.h" #define HASHUPDATE \ SHA256H V9.S4, V3, V2 \ SHA256H2 V9.S4, V8, V3 \ VMOV V2.B16, V8.B16 // func sha256block(h [...
go/src/crypto/sha256/sha256block_arm64.s/0
{ "file_path": "go/src/crypto/sha256/sha256block_arm64.s", "repo_id": "go", "token_count": 4326 }
217
// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on CRYPTOGAMS code with the following comment: // # ==================================================================== // # Written by Andy Polyakov ...
go/src/crypto/sha512/sha512block_ppc64x.s/0
{ "file_path": "go/src/crypto/sha512/sha512block_ppc64x.s", "repo_id": "go", "token_count": 9844 }
218
// Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package tls import ( "bytes" "crypto" "crypto/ecdsa" "crypto/ed25519" "crypto/elliptic" "crypto/rsa" "errors" "fmt" "hash" "io" ) // verifyHandshake...
go/src/crypto/tls/auth.go/0
{ "file_path": "go/src/crypto/tls/auth.go", "repo_id": "go", "token_count": 3788 }
219
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package tls_test import ( "crypto/tls" "crypto/x509" "log" "net/http" "net/http/httptest" "os" "time" ) // zeroSource is an io.Reader that returns an u...
go/src/crypto/tls/example_test.go/0
{ "file_path": "go/src/crypto/tls/example_test.go", "repo_id": "go", "token_count": 3982 }
220
>>> Flow 1 (client to server) 00000000 16 03 01 00 fe 01 00 00 fa 03 03 00 00 00 00 00 |................| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000020 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 |........... ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
go/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSAPKCS1v15/0
{ "file_path": "go/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSAPKCS1v15", "repo_id": "go", "token_count": 4966 }
221
>>> Flow 1 (client to server) 00000000 16 03 01 00 fe 01 00 00 fa 03 03 00 00 00 00 00 |................| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000020 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 |........... ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
go/src/crypto/tls/testdata/Client-TLSv12-RenegotiateTwiceRejected/0
{ "file_path": "go/src/crypto/tls/testdata/Client-TLSv12-RenegotiateTwiceRejected", "repo_id": "go", "token_count": 9650 }
222
>>> Flow 1 (client to server) 00000000 16 03 01 00 fe 01 00 00 fa 03 03 00 00 00 00 00 |................| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000020 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 |........... ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
go/src/crypto/tls/testdata/Client-TLSv13-KeyUpdate/0
{ "file_path": "go/src/crypto/tls/testdata/Client-TLSv13-KeyUpdate", "repo_id": "go", "token_count": 3852 }
223
>>> Flow 1 (client to server) 00000000 16 03 01 00 6d 01 00 00 69 03 03 e9 31 0f d0 25 |....m...i...1..%| 00000010 ef 25 a7 1a 9b 8c 4b a3 ca 2b a6 54 89 1c e1 68 |.%....K..+.T...h| 00000020 6f b2 b2 60 6f 8a dc 87 24 8c 7b 00 00 04 00 2f |o..`o...$.{..../| 00000030 00 ff 01 00 00 3c 00 16 00 00 00 17 00 00 ...
go/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven/0
{ "file_path": "go/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven", "repo_id": "go", "token_count": 4693 }
224
>>> Flow 1 (client to server) 00000000 16 03 01 01 0a 01 00 01 06 03 03 2d b6 ca ea 39 |...........-...9| 00000010 59 17 86 df 90 2f 73 e0 a0 5c 6e 28 09 78 69 d6 |Y..../s..\n(.xi.| 00000020 30 06 b7 7b 17 a9 79 30 2a d8 57 20 c5 5c ed 86 |0..{..y0*.W .\..| 00000030 15 f4 3b c8 d2 5f 7a 80 2a 6a cd 40 c2 da ...
go/src/crypto/tls/testdata/Server-TLSv12-Resume/0
{ "file_path": "go/src/crypto/tls/testdata/Server-TLSv12-Resume", "repo_id": "go", "token_count": 1950 }
225
>>> Flow 1 (client to server) 00000000 16 03 01 00 ca 01 00 00 c6 03 03 4a ea 7e 77 82 |...........J.~w.| 00000010 17 37 46 db 49 14 d2 41 e4 14 b0 46 20 9d 50 45 |.7F.I..A...F .PE| 00000020 d1 75 08 82 2b 8d bc 9a 75 e3 71 20 ce 77 9a 79 |.u..+...u.q .w.y| 00000030 98 24 bc 15 be ac 30 fe 66 35 ab 51 be bd ...
go/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedNotGiven/0
{ "file_path": "go/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedNotGiven", "repo_id": "go", "token_count": 3989 }
226
-----BEGIN EC PRIVATE KEY----- MHcCAQEEIIrYSSNQFaA2Hwf1duRSxKtLYX5CB04fSeQ6tF1aY/PuoAoGCCqGSM49 AwEHoUQDQgAEPR3tU2Fta9ktY+6P9G0cWO+0kETA6SFs38GecTyudlHz6xvCdz8q EKTcWGekdmdDPsHloRNtsiCa697B2O9IFA== -----END EC PRIVATE KEY-----
go/src/crypto/tls/testdata/example-key.pem/0
{ "file_path": "go/src/crypto/tls/testdata/example-key.pem", "repo_id": "go", "token_count": 143 }
227
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build dragonfly || freebsd || netbsd || openbsd package x509 // Possible certificate files; stop after finding one. var certFiles = []string{ "/usr/loca...
go/src/crypto/x509/root_bsd.go/0
{ "file_path": "go/src/crypto/x509/root_bsd.go", "repo_id": "go", "token_count": 288 }
228
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package x509 implements a subset of the X.509 standard. // // It allows parsing and generating certificates, certificate signing // requests, certificate rev...
go/src/crypto/x509/x509.go/0
{ "file_path": "go/src/crypto/x509/x509.go", "repo_id": "go", "token_count": 30845 }
229
// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package buildinfo provides access to information embedded in a Go binary // about how it was built. This includes the Go toolchain version, and the // set of...
go/src/debug/buildinfo/buildinfo.go/0
{ "file_path": "go/src/debug/buildinfo/buildinfo.go", "repo_id": "go", "token_count": 5023 }
230
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // cppunsuptypes.elf built with g++ 7.3 // g++ -g -c -o cppunsuptypes.elf cppunsuptypes.cc int i = 3; double d = 3; // anonymous reference type int &culpri...
go/src/debug/dwarf/testdata/cppunsuptypes.cc/0
{ "file_path": "go/src/debug/dwarf/testdata/cppunsuptypes.cc", "repo_id": "go", "token_count": 249 }
231
// clang -gdwarf-5 -O2 -nostdlib __attribute__((noinline, cold)) static int sum(int i) { int j, s; s = 0; for (j = 0; j < i; j++) { s += j * i; } return s; } int main(int argc, char** argv) { if (argc == 0) { return 0; } return sum(argc); }
go/src/debug/dwarf/testdata/rnglistx.c/0
{ "file_path": "go/src/debug/dwarf/testdata/rnglistx.c", "repo_id": "go", "token_count": 131 }
232
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package elf implements access to ELF object files. # Security This package is not designed to be hardened against adversarial inputs, and is outside the sc...
go/src/debug/elf/file.go/0
{ "file_path": "go/src/debug/elf/file.go", "repo_id": "go", "token_count": 18878 }
233
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gosym import ( "bytes" "compress/gzip" "debug/elf" "internal/testenv" "io" "os" "os/exec" "path/filepath" "runtime" "strings" "testing" ) v...
go/src/debug/gosym/pclntab_test.go/0
{ "file_path": "go/src/debug/gosym/pclntab_test.go", "repo_id": "go", "token_count": 4319 }
234
// Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package embedtest import ( "embed" "io" "reflect" "slices" "testing" "testing/fstest" ) //go:embed testdata/h*.txt //go:embed c*.txt testdata/g*.txt var...
go/src/embed/internal/embedtest/embed_test.go/0
{ "file_path": "go/src/embed/internal/embedtest/embed_test.go", "repo_id": "go", "token_count": 2375 }
235
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package asn1 implements parsing of DER-encoded ASN.1 data structures, // as defined in ITU-T Rec X.690. // // See also “A Layman's Guide to a Subset of ASN.1...
go/src/encoding/asn1/asn1.go/0
{ "file_path": "go/src/encoding/asn1/asn1.go", "repo_id": "go", "token_count": 11541 }
236
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package binary // This file implements "varint" encoding of 64-bit integers. // The encoding is: // - unsigned integers are serialized 7 bits at a time, starti...
go/src/encoding/binary/varint.go/0
{ "file_path": "go/src/encoding/binary/varint.go", "repo_id": "go", "token_count": 1782 }
237
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build ignore package main // Need to compile package gob with debug.go to build this program. // See comments in debug.go for how to do this. import ( ...
go/src/encoding/gob/dump.go/0
{ "file_path": "go/src/encoding/gob/dump.go", "repo_id": "go", "token_count": 225 }
238
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hex import ( "bytes" "fmt" "io" "strings" "testing" ) type encDecTest struct { enc string dec []byte } var encDecTests = []encDecTest{ {"", [...
go/src/encoding/hex/hex_test.go/0
{ "file_path": "go/src/encoding/hex/hex_test.go", "repo_id": "go", "token_count": 3818 }
239
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package json import ( "bytes" "errors" "io" ) // A Decoder reads and decodes JSON values from an input stream. type Decoder struct { r io.Reader bu...
go/src/encoding/json/stream.go/0
{ "file_path": "go/src/encoding/json/stream.go", "repo_id": "go", "token_count": 4741 }
240
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package xml import ( "bytes" "encoding" "errors" "fmt" "reflect" "runtime" "strconv" "strings" ) // BUG(rsc): Mapping between XML elements and data st...
go/src/encoding/xml/read.go/0
{ "file_path": "go/src/encoding/xml/read.go", "repo_id": "go", "token_count": 8459 }
241
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // These examples demonstrate more intricate uses of the flag package. package flag_test import ( "errors" "flag" "fmt" "strings" "time" ) // Example 1: ...
go/src/flag/example_test.go/0
{ "file_path": "go/src/flag/example_test.go", "repo_id": "go", "token_count": 845 }
242
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package fmt_test import ( "bufio" "bytes" "errors" . "fmt" "io" "math" "reflect" "regexp" "strings" "testing" "testing/iotest" "unicode/utf8" ) ty...
go/src/fmt/scan_test.go/0
{ "file_path": "go/src/fmt/scan_test.go", "repo_id": "go", "token_count": 18163 }
243
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ast import ( "strings" "testing" ) var tests = []struct { x any // x is printed as s s string }{ // basic types {nil, "0 nil"}, {true, "0 tru...
go/src/go/ast/print_test.go/0
{ "file_path": "go/src/go/ast/print_test.go", "repo_id": "go", "token_count": 905 }
244
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package build import ( "fmt" "go/token" "io" "strings" "testing" ) const quote = "`" type readTest struct { // Test input contains ℙ where readGoInfo s...
go/src/go/build/read_test.go/0
{ "file_path": "go/src/go/build/read_test.go", "repo_id": "go", "token_count": 2933 }
245
package doc
go/src/go/build/testdata/doc/c_test.go/0
{ "file_path": "go/src/go/build/testdata/doc/c_test.go", "repo_id": "go", "token_count": 3 }
246
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package constant implements Values representing untyped // Go constants and their corresponding operations. // // A special Unknown value may be used when a ...
go/src/go/constant/value.go/0
{ "file_path": "go/src/go/constant/value.go", "repo_id": "go", "token_count": 13570 }
247
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package doc import ( "cmp" "fmt" "go/ast" "go/token" "internal/lazyregexp" "path" "slices" "strconv" "strings" "unicode" "unicode/utf8" ) // ------...
go/src/go/doc/reader.go/0
{ "file_path": "go/src/go/doc/reader.go", "repo_id": "go", "token_count": 10551 }
248
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package blank is a go/doc test for the handling of _. // See issue 5397. package blank import "os" type T int // T constants counting from a blank constan...
go/src/go/doc/testdata/blank.go/0
{ "file_path": "go/src/go/doc/testdata/blank.go", "repo_id": "go", "token_count": 428 }
249
// Package issue12839 is a go/doc test to test association of a ... PACKAGE issue12839 IMPORTPATH testdata/issue12839 IMPORTS p FILENAMES testdata/issue12839.go FUNCTIONS // F1 should not be associated with T1 func F1() (*T1, *T2) // F10 should not be associated with T1. func F10() (T1, T2, error) // F4...
go/src/go/doc/testdata/issue12839.0.golden/0
{ "file_path": "go/src/go/doc/testdata/issue12839.0.golden", "repo_id": "go", "token_count": 381 }
250
// PACKAGE issue22856 IMPORTPATH testdata/issue22856 FILENAMES testdata/issue22856.go FUNCTIONS // NewPointerSliceOfSlice is not a factory function because slices ... func NewPointerSliceOfSlice() [][]*T // NewSlice3 is not a factory function because 3 nested slices of ... func NewSlice3() [][][]T // NewSl...
go/src/go/doc/testdata/issue22856.0.golden/0
{ "file_path": "go/src/go/doc/testdata/issue22856.0.golden", "repo_id": "go", "token_count": 259 }
251
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package format implements standard formatting of Go source. // // Note that formatting of Go source code changes over time, so tools relying on // consistent...
go/src/go/format/format.go/0
{ "file_path": "go/src/go/format/format.go", "repo_id": "go", "token_count": 1419 }
252
// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package parser import ( "fmt" "go/ast" "go/token" "strings" ) const debugResolve = false // resolveFile walks the given file to resolve identifiers withi...
go/src/go/parser/resolver.go/0
{ "file_path": "go/src/go/parser/resolver.go", "repo_id": "go", "token_count": 6539 }
253
This file should not be parsed by ParseDir.
go/src/go/parser/testdata/issue42951/not_a_file.go/invalid.go/0
{ "file_path": "go/src/go/parser/testdata/issue42951/not_a_file.go/invalid.go", "repo_id": "go", "token_count": 12 }
254
package sort type orderedSlice[Elem comparable] []Elem func (s orderedSlice[Elem]) Len() int { return len(s) } func (s orderedSlice[Elem]) Less(i, j int) bool { return s[i] < s[j] } func (s orderedSlice[Elem]) Swap(i, j int) { s[i], s[j] = s[j], s[i] } // OrderedSlice sorts the slice s in ascending or...
go/src/go/parser/testdata/sort.go2/0
{ "file_path": "go/src/go/parser/testdata/sort.go2", "repo_id": "go", "token_count": 403 }
255
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package token defines constants representing the lexical tokens of the Go // programming language and basic operations on tokens (printing, predicates). pack...
go/src/go/token/token.go/0
{ "file_path": "go/src/go/token/token.go", "repo_id": "go", "token_count": 2760 }
256
// Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package types_test import ( "fmt" "go/scanner" "go/token" "regexp" "strings" "testing" ) type comment struct { line, col int // comment position te...
go/src/go/types/commentMap_test.go/0
{ "file_path": "go/src/go/types/commentMap_test.go", "repo_id": "go", "token_count": 1179 }
257
// Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements (error and trace) message formatting support. package types import ( "bytes" "fmt" "go/ast" "go/token" "strconv" "strings" ) fu...
go/src/go/types/format.go/0
{ "file_path": "go/src/go/types/format.go", "repo_id": "go", "token_count": 1478 }
258
// Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package types_test import ( "go/importer" "go/token" "path/filepath" "runtime" "testing" . "go/types" ) // BenchmarkLookupFieldOrMethod measures types....
go/src/go/types/lookup_test.go/0
{ "file_path": "go/src/go/types/lookup_test.go", "repo_id": "go", "token_count": 453 }
259
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package types import ( "fmt" "go/ast" "go/constant" "go/internal/typeparams" "go/token" . "internal/types/errors" "sort" "strconv" "strings" "unicode...
go/src/go/types/resolver.go/0
{ "file_path": "go/src/go/types/resolver.go", "repo_id": "go", "token_count": 9830 }
260
// Code generated by "go test -run=Generate -write=all"; DO NOT EDIT. // Source: ../../cmd/compile/internal/types2/termlist_test.go // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package types import ( "s...
go/src/go/types/termlist_test.go/0
{ "file_path": "go/src/go/types/termlist_test.go", "repo_id": "go", "token_count": 3559 }
261
// Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "textflag.h" // castagnoliUpdate updates the non-inverted crc with the given data. // func castagnoliUpdate(crc uint32, p []byte) uint32 TEXT ·castag...
go/src/hash/crc32/crc32_arm64.s/0
{ "file_path": "go/src/hash/crc32/crc32_arm64.s", "repo_id": "go", "token_count": 897 }
262
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package fnv import ( "bytes" "encoding" "encoding/binary" "hash" "io" "testing" ) type golden struct { out []byte in string halfState st...
go/src/hash/fnv/fnv_test.go/0
{ "file_path": "go/src/hash/fnv/fnv_test.go", "repo_id": "go", "token_count": 4012 }
263
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package html import "testing" func FuzzEscapeUnescape(f *testing.F) { f.Fuzz(func(t *testing.T, v string) { e := EscapeString(v) u := UnescapeString(e) ...
go/src/html/fuzz_test.go/0
{ "file_path": "go/src/html/fuzz_test.go", "repo_id": "go", "token_count": 232 }
264
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package template import ( "bytes" "strings" ) // transitionFunc is the array of context transition functions for text nodes. // A transition function takes ...
go/src/html/template/transition.go/0
{ "file_path": "go/src/html/template/transition.go", "repo_id": "go", "token_count": 7802 }
265
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package draw provides image composition functions. // // See "The Go image/draw package" for an introduction to this package: // https://golang.org/doc/artic...
go/src/image/draw/draw.go/0
{ "file_path": "go/src/image/draw/draw.go", "repo_id": "go", "token_count": 17102 }
266
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package jpeg import ( "fmt" "math" "math/rand" "strings" "testing" ) func benchmarkDCT(b *testing.B, f func(*block)) { b.StopTimer() blocks := make([]b...
go/src/image/jpeg/dct_test.go/0
{ "file_path": "go/src/image/jpeg/dct_test.go", "repo_id": "go", "token_count": 4910 }
267
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package png import ( "bufio" "bytes" "fmt" "image" "image/color" "io" "os" "reflect" "strings" "testing" ) var filenames = []string{ "basn0g01", "...
go/src/image/png/reader_test.go/0
{ "file_path": "go/src/image/png/reader_test.go", "repo_id": "go", "token_count": 15128 }
268
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build ignore // Gen generates sais2.go by duplicating functions in sais.go // using different input types. // See the comment at the top of sais.go for de...
go/src/index/suffixarray/gen.go/0
{ "file_path": "go/src/index/suffixarray/gen.go", "repo_id": "go", "token_count": 817 }
269
// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package abi func FuncPCTestFn() var FuncPCTestFnAddr uintptr // address of FuncPCTestFn, directly retrieved from assembly //go:noinline func FuncPCTest() uin...
go/src/internal/abi/export_test.go/0
{ "file_path": "go/src/internal/abi/export_test.go", "repo_id": "go", "token_count": 123 }
270
// Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "go_asm.h" #include "textflag.h" TEXT ·Compare<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-56 // X10 = a_base // X11 = a_len // X12 = a_cap (unused) // X1...
go/src/internal/bytealg/compare_riscv64.s/0
{ "file_path": "go/src/internal/bytealg/compare_riscv64.s", "repo_id": "go", "token_count": 2386 }
271
// Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "go_asm.h" #include "textflag.h" #define REGCTXT R29 // memequal(a, b unsafe.Pointer, size uintptr) bool TEXT runtime·memequal<ABIInternal>(SB),NOSPL...
go/src/internal/bytealg/equal_loong64.s/0
{ "file_path": "go/src/internal/bytealg/equal_loong64.s", "repo_id": "go", "token_count": 441 }
272
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package bytealg import "internal/cpu" const MaxBruteForce = 64 func init() { // Note: we're kind of lucky that this flag is available at this point. // The...
go/src/internal/bytealg/index_s390x.go/0
{ "file_path": "go/src/internal/bytealg/index_s390x.go", "repo_id": "go", "token_count": 283 }
273
// Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package byteorder provides functions for decoding and encoding // little and big endian integer types from/to byte slices. package byteorder func LeUint16(b...
go/src/internal/byteorder/byteorder.go/0
{ "file_path": "go/src/internal/byteorder/byteorder.go", "repo_id": "go", "token_count": 1627 }
274
// Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cfile import "internal/runtime/exithook" // InitHook is invoked from the main package "init" routine in // programs built with "-cover". This function...
go/src/internal/coverage/cfile/hooks.go/0
{ "file_path": "go/src/internal/coverage/cfile/hooks.go", "repo_id": "go", "token_count": 457 }
275
// Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package coverage // Types and constants related to the output files written // by code coverage tooling. When a coverage-instrumented binary // is run, it emit...
go/src/internal/coverage/defs.go/0
{ "file_path": "go/src/internal/coverage/defs.go", "repo_id": "go", "token_count": 3909 }
276
// Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package cpu implements processor feature detection // used by the Go standard library. package cpu import _ "unsafe" // for linkname // DebugOptions is set...
go/src/internal/cpu/cpu.go/0
{ "file_path": "go/src/internal/cpu/cpu.go", "repo_id": "go", "token_count": 2584 }
277
// Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !386 && !amd64 && !ppc64 && !ppc64le package cpu // Name returns the CPU name given by the vendor // if it can be read directly from memory or by C...
go/src/internal/cpu/cpu_no_name.go/0
{ "file_path": "go/src/internal/cpu/cpu_no_name.go", "repo_id": "go", "token_count": 171 }
278
// Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package dag // Transpose reverses all edges in g. func (g *Graph) Transpose() { old := g.edges g.edges = make(map[string]map[string]bool) for _, n := range...
go/src/internal/dag/alg.go/0
{ "file_path": "go/src/internal/dag/alg.go", "repo_id": "go", "token_count": 599 }
279
// Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package fuzz import ( "bytes" "fmt" "os" "unsafe" ) // sharedMem manages access to a region of virtual memory mapped from a file, // shared between multip...
go/src/internal/fuzz/mem.go/0
{ "file_path": "go/src/internal/fuzz/mem.go", "repo_id": "go", "token_count": 1342 }
280
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build ignore package main import ( "bytes" "fmt" "log" "os" "strings" ) var goarches []string func main() { data, err := os.ReadFile("../../go/bu...
go/src/internal/goarch/gengoarch.go/0
{ "file_path": "go/src/internal/goarch/gengoarch.go", "repo_id": "go", "token_count": 629 }
281
// Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.boringcrypto package goexperiment const BoringCrypto = true const BoringCryptoInt = 1
go/src/internal/goexperiment/exp_boringcrypto_on.go/0
{ "file_path": "go/src/internal/goexperiment/exp_boringcrypto_on.go", "repo_id": "go", "token_count": 53 }
282
// Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.preemptibleloops package goexperiment const PreemptibleLoops = true const PreemptibleLoopsInt = 1
go/src/internal/goexperiment/exp_preemptibleloops_on.go/0
{ "file_path": "go/src/internal/goexperiment/exp_preemptibleloops_on.go", "repo_id": "go", "token_count": 56 }
283
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc package goroot import ( "os" "os/exec" "path/filepath" "strings" "sync" ) // IsStandardPackage reports whether path is a standard package,...
go/src/internal/goroot/gc.go/0
{ "file_path": "go/src/internal/goroot/gc.go", "repo_id": "go", "token_count": 1237 }
284
// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package pkgbits import ( "encoding/binary" "errors" "fmt" "go/constant" "go/token" "io" "math/big" "os" "runtime" "strings" ) // A PkgDecoder provid...
go/src/internal/pkgbits/decoder.go/0
{ "file_path": "go/src/internal/pkgbits/decoder.go", "repo_id": "go", "token_count": 5137 }
285
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package poll_test import ( "fmt" "io/fs" "net" "os" "testing" "time" ) func TestReadError(t *testing.T) { t.Run("ErrNotPollable", func(t *testing.T) { ...
go/src/internal/poll/error_test.go/0
{ "file_path": "go/src/internal/poll/error_test.go", "repo_id": "go", "token_count": 448 }
286
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build unix || (js && wasm) || wasip1 || windows package poll import ( "io" "syscall" ) // eofError returns io.EOF when fd is available for reading end...
go/src/internal/poll/fd_posix.go/0
{ "file_path": "go/src/internal/poll/fd_posix.go", "repo_id": "go", "token_count": 721 }
287
// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build unix package poll import ( "io" "runtime" "syscall" ) // Writev wraps the writev system call. func (fd *FD) Writev(v *[][]byte) (int64, error) ...
go/src/internal/poll/writev.go/0
{ "file_path": "go/src/internal/poll/writev.go", "repo_id": "go", "token_count": 868 }
288
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package reflectlite import ( "unsafe" ) // Field returns the i'th field of the struct v. // It panics if v's Kind is not Struct or i is out of range. func Fi...
go/src/internal/reflectlite/export_test.go/0
{ "file_path": "go/src/internal/reflectlite/export_test.go", "repo_id": "go", "token_count": 1093 }
289
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "go_asm.h" #include "textflag.h" TEXT ·Casint32(SB), NOSPLIT, $0-17 B ·Cas(SB) TEXT ·Casint64(SB), NOSPLIT, $0-25 B ·Cas64(SB) TEXT ·Casuintptr(SB...
go/src/internal/runtime/atomic/atomic_arm64.s/0
{ "file_path": "go/src/internal/runtime/atomic/atomic_arm64.s", "repo_id": "go", "token_count": 5143 }
290
// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package atomic_test import ( "internal/runtime/atomic" "testing" ) var sink any func BenchmarkAtomicLoad64(b *testing.B) { var x uint64 sink = &x for i ...
go/src/internal/runtime/atomic/bench_test.go/0
{ "file_path": "go/src/internal/runtime/atomic/bench_test.go", "repo_id": "go", "token_count": 1601 }
291
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package sys // NOTE: keep in sync with cmd/compile/internal/types.CalcSize // to make the compiler recognize this as an intrinsic type. type nih struct{} // N...
go/src/internal/runtime/sys/nih.go/0
{ "file_path": "go/src/internal/runtime/sys/nih.go", "repo_id": "go", "token_count": 506 }
292
// Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unix import ( "internal/abi" "unsafe" ) //go:cgo_import_dynamic libc_arc4random_buf arc4random_buf "/usr/lib/libSystem.B.dylib" func libc_arc4rando...
go/src/internal/syscall/unix/arc4random_darwin.go/0
{ "file_path": "go/src/internal/syscall/unix/arc4random_darwin.go", "repo_id": "go", "token_count": 240 }
293
// Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unix import "syscall" func PosixFallocate(fd int, off int64, size int64) error { // If successful, posix_fallocate() returns zero. It returns an erro...
go/src/internal/syscall/unix/fallocate_freebsd_arm.go/0
{ "file_path": "go/src/internal/syscall/unix/fallocate_freebsd_arm.go", "repo_id": "go", "token_count": 351 }
294
// Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build solaris package unix_test import ( "internal/syscall/unix" "runtime" "syscall" "testing" ) func TestSupportSockNonblockCloexec(t *testing.T) {...
go/src/internal/syscall/unix/kernel_version_solaris_test.go/0
{ "file_path": "go/src/internal/syscall/unix/kernel_version_solaris_test.go", "repo_id": "go", "token_count": 863 }
295
// Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unix_test import ( "internal/goarch" "internal/syscall/unix" "runtime" "strings" "testing" "unsafe" ) // TestSiginfoChildLayout validates Siginf...
go/src/internal/syscall/unix/siginfo_linux_test.go/0
{ "file_path": "go/src/internal/syscall/unix/siginfo_linux_test.go", "repo_id": "go", "token_count": 554 }
296
// Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package windows type PROCESS_MEMORY_COUNTERS struct { CB uint32 PageFaultCount uint32 PeakWorkingSetSize uintptr...
go/src/internal/syscall/windows/psapi_windows.go/0
{ "file_path": "go/src/internal/syscall/windows/psapi_windows.go", "repo_id": "go", "token_count": 294 }
297
// Code generated by 'go generate'; DO NOT EDIT. package windows import ( "internal/syscall/windows/sysdll" "syscall" "unsafe" ) var _ unsafe.Pointer // Do the interface allocations only once for common // Errno values. const ( errnoERROR_IO_PENDING = 997 ) var ( errERROR_IO_PENDING error = syscall.Errno(errn...
go/src/internal/syscall/windows/zsyscall_windows.go/0
{ "file_path": "go/src/internal/syscall/windows/zsyscall_windows.go", "repo_id": "go", "token_count": 7764 }
298
// Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package testlog import ( "sync" _ "unsafe" // for linkname ) // PanicOnExit0 reports whether to panic on a call to os.Exit(0). // This is in the testlog pac...
go/src/internal/testlog/exit.go/0
{ "file_path": "go/src/internal/testlog/exit.go", "repo_id": "go", "token_count": 406 }
299