text
stringlengths
2
1.1M
id
stringlengths
11
117
metadata
dict
__index_level_0__
int64
0
885
// 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 acmetest provides types for testing acme and autocert packages. // // TODO: Consider moving this to x/crypto/acme/internal/acmetest for acme tests as...
crypto/acme/autocert/internal/acmetest/ca.go/0
{ "file_path": "crypto/acme/autocert/internal/acmetest/ca.go", "repo_id": "crypto", "token_count": 9238 }
0
// 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 amd64 && gc && !purego package argon2 import "golang.org/x/sys/cpu" func init() { useSSE4 = cpu.X86.HasSSE41 } //go:noescape func mixBlocksSSE2(...
crypto/argon2/blamka_amd64.go/0
{ "file_path": "crypto/argon2/blamka_amd64.go", "repo_id": "crypto", "token_count": 729 }
1
// 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 blake2s implements the BLAKE2s hash algorithm defined by RFC 7693 // and the extendable output function (XOF) BLAKE2Xs. // // BLAKE2s is optimized fo...
crypto/blake2s/blake2s.go/0
{ "file_path": "crypto/blake2s/blake2s.go", "repo_id": "crypto", "token_count": 2521 }
2
// 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 bn256 import ( "math/big" ) // curvePoint implements the elliptic curve y²=x³+3. Points are kept in // Jacobian form and t=z² when valid. G₁ is the s...
crypto/bn256/curve.go/0
{ "file_path": "crypto/bn256/curve.go", "repo_id": "crypto", "token_count": 3206 }
3
// 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 && !purego #include "go_asm.h" #include "textflag.h" // This is an implementation of the ChaCha20 encryption algorithm as // specified in RFC 75...
crypto/chacha20/chacha_s390x.s/0
{ "file_path": "crypto/chacha20/chacha_s390x.s", "repo_id": "crypto", "token_count": 3306 }
4
// 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 wycheproof import ( "bytes" "crypto/aes" "crypto/cipher" "fmt" "testing" "golang.org/x/crypto/chacha20poly1305" ) func TestAEAD(t *testing.T) {...
crypto/internal/wycheproof/aead_test.go/0
{ "file_path": "crypto/internal/wycheproof/aead_test.go", "repo_id": "crypto", "token_count": 1997 }
5
// 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 ocsp import ( "bytes" "crypto" "crypto/rand" "crypto/rsa" "crypto/sha1" "crypto/x509" "crypto/x509/pkix" "encoding/asn1" "encoding/hex" "enco...
crypto/ocsp/ocsp_test.go/0
{ "file_path": "crypto/ocsp/ocsp_test.go", "repo_id": "crypto", "token_count": 18098 }
6
// 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 packet import ( "crypto" "crypto/rand" "io" "time" ) // Config collects a number of parameters along with sensible defaults. // A nil *Config is v...
crypto/openpgp/packet/config.go/0
{ "file_path": "crypto/openpgp/packet/config.go", "repo_id": "crypto", "token_count": 814 }
7
// 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 packet import ( "bytes" "encoding/hex" "testing" "time" ) var pubKeyV3Test = struct { hexFingerprint string creationTime time.Time pubKeyAlgo...
crypto/openpgp/packet/public_key_v3_test.go/0
{ "file_path": "crypto/openpgp/packet/public_key_v3_test.go", "repo_id": "crypto", "token_count": 1058 }
8
// 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 s2k implements the various OpenPGP string-to-key transforms as // specified in RFC 4800 section 3.7.1. // // Deprecated: this package is unmaintained...
crypto/openpgp/s2k/s2k.go/0
{ "file_path": "crypto/openpgp/s2k/s2k.go", "repo_id": "crypto", "token_count": 2716 }
9
// 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. // Package rc2 implements the RC2 cipher /* https://www.ietf.org/rfc/rfc2268.txt http://people.csail.mit.edu/rivest/pubs/KRRR98.pdf This code is licensed under...
crypto/pkcs12/internal/rc2/rc2.go/0
{ "file_path": "crypto/pkcs12/internal/rc2/rc2.go", "repo_id": "crypto", "token_count": 3945 }
10
// 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. //go:build amd64 && !purego && gc // This code was translated into a form compatible with 6a from the public // domain sources in SUPERCOP: https://bench.cr.yp...
crypto/salsa20/salsa/salsa20_amd64.s/0
{ "file_path": "crypto/salsa20/salsa/salsa20_amd64.s", "repo_id": "crypto", "token_count": 9767 }
11
// 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 agent import ( "bytes" "crypto/rand" "crypto/subtle" "errors" "fmt" "sync" "time" "golang.org/x/crypto/ssh" ) type privKey struct { signer ...
crypto/ssh/agent/keyring.go/0
{ "file_path": "crypto/ssh/agent/keyring.go", "repo_id": "crypto", "token_count": 2086 }
12
// 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 ssh import ( "bytes" "crypto/rand" "errors" "fmt" "net" "strings" "testing" ) func TestClientVersion(t *testing.T) { for _, tt := range []stru...
crypto/ssh/client_test.go/0
{ "file_path": "crypto/ssh/client_test.go", "repo_id": "crypto", "token_count": 3908 }
13
// 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 ssh // Message authentication support import ( "crypto/hmac" "crypto/sha1" "crypto/sha256" "crypto/sha512" "hash" ) type macMode struct { keySi...
crypto/ssh/mac.go/0
{ "file_path": "crypto/ssh/mac.go", "repo_id": "crypto", "token_count": 647 }
14
// 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 terminal provides support functions for dealing with terminals, as // commonly found on UNIX systems. // // Deprecated: this package moved to golang....
crypto/ssh/terminal/terminal.go/0
{ "file_path": "crypto/ssh/terminal/terminal.go", "repo_id": "crypto", "token_count": 699 }
15
// 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. // IMPLEMENTATION NOTE: To avoid a package loop, this file is in three places: // ssh/, ssh/agent, and ssh/test/. It should be kept in sync across all three // ...
crypto/ssh/testdata_test.go/0
{ "file_path": "crypto/ssh/testdata_test.go", "repo_id": "crypto", "token_count": 856 }
16
// 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 xts implements the XTS cipher mode as specified in IEEE P1619/D16. // // XTS mode is typically used for disk encryption, which presents a number of /...
crypto/xts/xts.go/0
{ "file_path": "crypto/xts/xts.go", "repo_id": "crypto", "token_count": 1772 }
17
// 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 main import ( "bytes" "fmt" "hash/fnv" "sort" "strings" ) type graphviz struct { ps []*gvnode b bytes.Buffer h map[string]uint32 // cluster...
dep/cmd/dep/graphviz.go/0
{ "file_path": "dep/cmd/dep/graphviz.go", "repo_id": "dep", "token_count": 2965 }
18
digraph { node [shape=box]; compound=true; edge [minlen=2]; 552838292 [label="ProjectA/pkgX"]; 569615911 [label="ProjectA/pkgY"]; 2062426895 [label="ProjectB/pkgX"]; 2045649276 [label="ProjectB/pkgY"]; 990902230 [label="ProjectC/pkgX"]; 1007679849 [label="ProjectC/pkgY"]; 957346992 [label="ProjectC/pkgZ"]; s...
dep/cmd/dep/testdata/graphviz/subgraph1.dot/0
{ "file_path": "dep/cmd/dep/testdata/graphviz/subgraph1.dot", "repo_id": "dep", "token_count": 278 }
19
noverify = ["github.com/sdboyer/deptest"]
dep/cmd/dep/testdata/harness_tests/check/noverify/vendororphans/final/Gopkg.toml/0
{ "file_path": "dep/cmd/dep/testdata/harness_tests/check/noverify/vendororphans/final/Gopkg.toml", "repo_id": "dep", "token_count": 18 }
20
{ "commands": [ ["init", "-no-examples"], ["ensure", "-add", "github.com/sdboyer/deptesttres", "github.com/sdboyer/deptesttres/subp"] ], "vendor-final": [ "github.com/sdboyer/deptest", "github.com/sdboyer/deptesttres" ] }
dep/cmd/dep/testdata/harness_tests/ensure/add/all-new-double/testcase.json/0
{ "file_path": "dep/cmd/dep/testdata/harness_tests/ensure/add/all-new-double/testcase.json", "repo_id": "dep", "token_count": 123 }
21
{ "commands": [ ["ensure", "-add", "github.com/sdboyer/deptesttres@master"] ], "vendor-final": [ "github.com/sdboyer/deptest", "github.com/sdboyer/deptestdos", "github.com/sdboyer/deptesttres" ] }
dep/cmd/dep/testdata/harness_tests/ensure/add/desync/testcase.json/0
{ "file_path": "dep/cmd/dep/testdata/harness_tests/ensure/add/desync/testcase.json", "repo_id": "dep", "token_count": 114 }
22
{ "commands": [ ["ensure", "-add", "github.com/sdboyer/deptest"] ], "error-expected": "nothing to -add, github.com/sdboyer/deptest is already in Gopkg.toml and the project's direct imports or required list" }
dep/cmd/dep/testdata/harness_tests/ensure/add/errs/exists/testcase.json/0
{ "file_path": "dep/cmd/dep/testdata/harness_tests/ensure/add/errs/exists/testcase.json", "repo_id": "dep", "token_count": 81 }
23
noverify = ["github.com/sdboyer/deptest"]
dep/cmd/dep/testdata/harness_tests/ensure/noverify/hash_mismatch/initial/Gopkg.toml/0
{ "file_path": "dep/cmd/dep/testdata/harness_tests/ensure/noverify/hash_mismatch/initial/Gopkg.toml", "repo_id": "dep", "token_count": 18 }
24
ignored = ["github.com/sdboyer/deptest*", "github.com/golang/notexist/samples*"]
dep/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/final/Gopkg.toml/0
{ "file_path": "dep/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/final/Gopkg.toml", "repo_id": "dep", "token_count": 34 }
25
Ignore glide config if glide.yaml is malformed and cannot be parsed correctly.
dep/cmd/dep/testdata/harness_tests/init/glide/case4/README.md/0
{ "file_path": "dep/cmd/dep/testdata/harness_tests/init/glide/case4/README.md", "repo_id": "dep", "token_count": 19 }
26
[[constraint]] name = "github.com/ChinmayR/deptestglideA" version = "0.6.0"
dep/cmd/dep/testdata/harness_tests/init/glide/trans-trans-trans/final/Gopkg.toml/0
{ "file_path": "dep/cmd/dep/testdata/harness_tests/init/glide/trans-trans-trans/final/Gopkg.toml", "repo_id": "dep", "token_count": 39 }
27
{ "commands": [ ["init"] ], "error-expected": "init aborted: manifest already exists", "vendor-final": [] }
dep/cmd/dep/testdata/harness_tests/init/manifest-exists/testcase.json/0
{ "file_path": "dep/cmd/dep/testdata/harness_tests/init/manifest-exists/testcase.json", "repo_id": "dep", "token_count": 45 }
28
// 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 main import ( "flag" "runtime" "github.com/golang/dep" ) var ( version = "devel" buildDate string commitHash string ) const versionHelp = ...
dep/cmd/dep/version.go/0
{ "file_path": "dep/cmd/dep/version.go", "repo_id": "dep", "token_count": 377 }
29
--- id: glossary title: Glossary --- dep uses some specialized terminology. Learn about it here! * [Atom](#atom) * [Cache lock](#cache-lock) * [Constraint](#constraint) * [Current Project](#current-project) * [Deducible](#deducible) * [Deduction](#deduction) * [Direct Dependency](#direct-dependency) * [External Impor...
dep/docs/glossary.md/0
{ "file_path": "dep/docs/glossary.md", "repo_id": "dep", "token_count": 2325 }
30
// 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 gps import ( "fmt" "math/rand" "strconv" ) // ProjectRoot is the topmost import path in a tree of other import paths - the // root of the tree. In ...
dep/gps/identifier.go/0
{ "file_path": "dep/gps/identifier.go", "repo_id": "dep", "token_count": 2059 }
31
// 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 pkgtree import ( "bytes" "fmt" "go/ast" "go/build" "go/parser" gscan "go/scanner" "go/token" "os" "path/filepath" "sort" "strconv" "strings...
dep/gps/pkgtree/pkgtree.go/0
{ "file_path": "dep/gps/pkgtree/pkgtree.go", "repo_id": "dep", "token_count": 11647 }
32
// 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 gps import ( "container/heap" "context" "fmt" "log" "sort" "strings" "sync" "sync/atomic" "github.com/armon/go-radix" "github.com/golang/dep...
dep/gps/solver.go/0
{ "file_path": "dep/gps/solver.go", "repo_id": "dep", "token_count": 14966 }
33
// 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 gps import ( "fmt" "strconv" "strings" "github.com/golang/dep/gps/pkgtree" ) const ( successChar = "✓" successCharSp = successChar + " " fai...
dep/gps/trace.go/0
{ "file_path": "dep/gps/trace.go", "repo_id": "dep", "token_count": 2175 }
34
// 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 verify import ( "strings" "testing" "github.com/golang/dep/gps" "github.com/golang/dep/gps/pkgtree" ) type lockUnsatisfactionDimension uint8 con...
dep/gps/verify/locksat_test.go/0
{ "file_path": "dep/gps/verify/locksat_test.go", "repo_id": "dep", "token_count": 2926 }
35
// 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 feedback import ( "bytes" "testing" "github.com/golang/dep/gps" ) // mkPI creates a ProjectIdentifier with the ProjectRoot as the provided // stri...
dep/internal/feedback/lockdiff_test.go/0
{ "file_path": "dep/internal/feedback/lockdiff_test.go", "repo_id": "dep", "token_count": 4988 }
36
// 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 glock import ( "bufio" "fmt" "log" "os" "path/filepath" "strings" "github.com/golang/dep" "github.com/golang/dep/gps" "github.com/golang/dep/...
dep/internal/importers/glock/importer.go/0
{ "file_path": "dep/internal/importers/glock/importer.go", "repo_id": "dep", "token_count": 1302 }
37
// 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 gvt import ( "encoding/json" "io/ioutil" "log" "os" "path/filepath" "github.com/golang/dep" "github.com/golang/dep/gps" "github.com/golang/dep...
dep/internal/importers/gvt/importer.go/0
{ "file_path": "dep/internal/importers/gvt/importer.go", "repo_id": "dep", "token_count": 1293 }
38
// 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 dep import ( "reflect" "strings" "testing" "github.com/golang/dep/gps" "github.com/golang/dep/gps/verify" "github.com/golang/dep/internal/test" ...
dep/lock_test.go/0
{ "file_path": "dep/lock_test.go", "repo_id": "dep", "token_count": 2066 }
39
package semver import "strings" type unionConstraint []realConstraint func (uc unionConstraint) Matches(v Version) error { var uce MultiMatchFailure for _, c := range uc { err := c.Matches(v) if err == nil { return nil } uce = append(uce, err.(MatchFailure)) } return uce } func (uc unionConstraint)...
dep/vendor/github.com/Masterminds/semver/union.go/0
{ "file_path": "dep/vendor/github.com/Masterminds/semver/union.go", "repo_id": "dep", "token_count": 1201 }
40
package bolt import "unsafe" // maxMapSize represents the largest mmap size supported by Bolt. const maxMapSize = 0x7FFFFFFF // 2GB // maxAllocSize is the size used when creating array pointers. const maxAllocSize = 0xFFFFFFF // Are unaligned load/stores broken on this arch? var brokenUnaligned bool func init() { ...
dep/vendor/github.com/boltdb/bolt/bolt_arm.go/0
{ "file_path": "dep/vendor/github.com/boltdb/bolt/bolt_arm.go", "repo_id": "dep", "token_count": 277 }
41
package bolt import "errors" // These errors can be returned when opening or calling methods on a DB. var ( // ErrDatabaseNotOpen is returned when a DB instance is accessed before it // is opened or after it is closed. ErrDatabaseNotOpen = errors.New("database not open") // ErrDatabaseOpen is returned when openi...
dep/vendor/github.com/boltdb/bolt/errors.go/0
{ "file_path": "dep/vendor/github.com/boltdb/bolt/errors.go", "repo_id": "dep", "token_count": 734 }
42
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2012 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met...
dep/vendor/github.com/golang/protobuf/proto/pointer_reflect.go/0
{ "file_path": "dep/vendor/github.com/golang/protobuf/proto/pointer_reflect.go", "repo_id": "dep", "token_count": 5164 }
43
// 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.md file. // +build purego appengine js package cmp import "reflect" const supportAllowUnexported = false func unsafeRetrieveField(reflect.Value, reflect.StructFi...
dep/vendor/github.com/google/go-cmp/cmp/unsafe_panic.go/0
{ "file_path": "dep/vendor/github.com/google/go-cmp/cmp/unsafe_panic.go", "repo_id": "dep", "token_count": 110 }
44
package toml import ( "bytes" "errors" "fmt" "io" "reflect" "strconv" "strings" "time" ) const tagKeyMultiline = "multiline" type tomlOpts struct { name string comment string commented bool multiline bool include bool omitempty bool } type encOpts struct { quoteMapKeys bool array...
dep/vendor/github.com/pelletier/go-toml/marshal.go/0
{ "file_path": "dep/vendor/github.com/pelletier/go-toml/marshal.go", "repo_id": "dep", "token_count": 6773 }
45
// 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 context defines the Context type, which carries deadlines, // cancelation signals, and other request-scoped values across API boundaries // and betwe...
dep/vendor/golang.org/x/net/context/context.go/0
{ "file_path": "dep/vendor/golang.org/x/net/context/context.go", "repo_id": "dep", "token_count": 569 }
46
// 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. // +build darwin dragonfly freebsd netbsd openbsd // BSD system call wrappers shared by *BSD based systems // including OS X (Darwin) and FreeBSD. Like the ot...
dep/vendor/golang.org/x/sys/unix/syscall_bsd.go/0
{ "file_path": "dep/vendor/golang.org/x/sys/unix/syscall_bsd.go", "repo_id": "dep", "token_count": 6968 }
47
// 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. // Solaris system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates syste...
dep/vendor/golang.org/x/sys/unix/syscall_solaris.go/0
{ "file_path": "dep/vendor/golang.org/x/sys/unix/syscall_solaris.go", "repo_id": "dep", "token_count": 8464 }
48
package yaml import ( "bytes" "fmt" ) // Introduction // ************ // // The following notes assume that you are familiar with the YAML specification // (http://yaml.org/spec/1.2/spec.html). We mostly follow it, although in // some cases we are less restrictive that it requires. // // The process of transformin...
dep/vendor/gopkg.in/yaml.v2/scannerc.go/0
{ "file_path": "dep/vendor/gopkg.in/yaml.v2/scannerc.go", "repo_id": "dep", "token_count": 31788 }
49
{ "docs": { "Guides": ["introduction", "installation", "new-project", "migrating", "daily-dep", "uninstalling"], "References": ["ensure-mechanics", "failure-modes", "the-solver", "deduction", "Gopkg.toml", "Gopkg.lock", "FAQ", "env-vars", "glossary"] } }
dep/website/sidebars.json/0
{ "file_path": "dep/website/sidebars.json", "repo_id": "dep", "token_count": 110 }
50
# Go example projects [![Go Reference](https://pkg.go.dev/badge/golang.org/x/example.svg)](https://pkg.go.dev/golang.org/x/example) This repository contains a collection of Go programs and libraries that demonstrate the language, standard libraries, and tools. ## Clone the project ``` $ git clone https://go.googles...
example/README.md/0
{ "file_path": "example/README.md", "repo_id": "example", "token_count": 1015 }
51
// !+ package main import "fmt" func main() { fmt.Println("Hello, 世界") } //!-
example/gotypes/hello/hello.go/0
{ "file_path": "example/gotypes/hello/hello.go", "repo_id": "example", "token_count": 43 }
52
module golang.org/x/example/outyet go 1.19
example/outyet/go.mod/0
{ "file_path": "example/outyet/go.mod", "repo_id": "example", "token_count": 19 }
53
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>{{.Title}}</title> <style> body { font-family: sans-serif; } h1 { background: #ddd; } #sidebar { float: right; } </style> </head> <body> <h1>{{.Title}}</h1> <div id="sidebar"> {{block "sidebar" .}} <h2>Links<...
example/template/index.tmpl/0
{ "file_path": "example/template/index.tmpl", "repo_id": "example", "token_count": 353 }
54
package glog import ( "flag" "io/ioutil" "runtime" "sync" "sync/atomic" "testing" "time" ) // discarder is a flushSyncWriter that discards all data. // Sync sleeps for 10ms to simulate a disk seek. type discarder struct { } func (d *discarder) Write(data []byte) (int, error) { return len(data), nil } func (...
glog/glog_bench_test.go/0
{ "file_path": "glog/glog_bench_test.go", "repo_id": "glog", "token_count": 1331 }
55
// Copyright 2023 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
glog/internal/stackdump/stackdump.go/0
{ "file_path": "glog/internal/stackdump/stackdump.go", "repo_id": "glog", "token_count": 1213 }
56
## Tools {#tools} ### Go command {#go-command} ### Cgo {#cgo}
go/doc/initial/3-tools.md/0
{ "file_path": "go/doc/initial/3-tools.md", "repo_id": "go", "token_count": 28 }
57
# This file contains the initial defaults for go command configuration. # Values set by 'go env -w' and written to the user's go/env file override these. # The environment overrides everything else. # Use the Go module mirror and checksum database by default. # See https://proxy.golang.org for details. GOPROXY=https:/...
go/go.env/0
{ "file_path": "go/go.env", "repo_id": "go", "token_count": 146 }
58
For information about plugins and other support for Go in editors and shells, see this page on the Go Wiki: https://golang.org/wiki/IDEsAndTextEditorPlugins
go/misc/editors/0
{ "file_path": "go/misc/editors", "repo_id": "go", "token_count": 43 }
59
Vendoring in std and cmd ======================== The Go command maintains copies of external packages needed by the standard library in the src/vendor and src/cmd/vendor directories. There are two modules, std and cmd, defined in src/go.mod and src/cmd/go.mod. When a package outside std or cmd is imported by a packa...
go/src/README.vendor/0
{ "file_path": "go/src/README.vendor", "repo_id": "go", "token_count": 572 }
60
// 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 zip import ( "bytes" "io" "os" "path/filepath" "testing" ) func FuzzReader(f *testing.F) { testdata, err := os.ReadDir("testdata") if err != ni...
go/src/archive/zip/fuzz_test.go/0
{ "file_path": "go/src/archive/zip/fuzz_test.go", "repo_id": "go", "token_count": 715 }
61
// 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 bufio import ( "bytes" "errors" "io" "unicode/utf8" ) // Scanner provides a convenient interface for reading data such as // a file of newline-del...
go/src/bufio/scan.go/0
{ "file_path": "go/src/bufio/scan.go", "repo_id": "go", "token_count": 4945 }
62
:: 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. @echo off setlocal set GOBUILDFAIL=0 go tool dist env -w -p >env.bat if errorlevel 1 goto fail call .\env.bat del env.bat echo. if exist %GOTOOLDIR%\dist.ex...
go/src/clean.bat/0
{ "file_path": "go/src/clean.bat", "repo_id": "go", "token_count": 225 }
63
// 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. // This file encapsulates some of the odd characteristics of the // s390x instruction set, to minimize its interaction // with the core of the assembler. packa...
go/src/cmd/asm/internal/arch/s390x.go/0
{ "file_path": "go/src/cmd/asm/internal/arch/s390x.go", "repo_id": "go", "token_count": 624 }
64
// 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. // This input was created by taking the instruction productions in // the old assembler's (7a's) grammar and hand-writing complete // instructions for each rule...
go/src/cmd/asm/internal/asm/testdata/arm64.s/0
{ "file_path": "go/src/cmd/asm/internal/asm/testdata/arm64.s", "repo_id": "go", "token_count": 72519 }
65
// Code generated by avx512test. DO NOT EDIT. #include "../../../../../../runtime/textflag.h" TEXT asmtest_avx512dq(SB), NOSPLIT, $0 KADDB K3, K1, K6 // c5f54af3 KADDB K1, K1, K6 // c5f54af1 KADDB K3, K5, K6 // c5...
go/src/cmd/asm/internal/asm/testdata/avx512enc/avx512dq.s/0
{ "file_path": "go/src/cmd/asm/internal/asm/testdata/avx512enc/avx512dq.s", "repo_id": "go", "token_count": 142064 }
66
// 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. #include "../../../../../runtime/textflag.h" TEXT asmtest(SB),DUPOK|NOSPLIT,$0 start: // Unprivileged ISA // 2.4: Integer Computational Instructions ADDI ...
go/src/cmd/asm/internal/asm/testdata/riscv64.s/0
{ "file_path": "go/src/cmd/asm/internal/asm/testdata/riscv64.s", "repo_id": "go", "token_count": 10762 }
67
// 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. /* Cgo enables the creation of Go packages that call C code. # Using cgo with the go command To use cgo write normal Go code that imports a pseudo-package "C"...
go/src/cmd/cgo/doc.go/0
{ "file_path": "go/src/cmd/cgo/doc.go", "repo_id": "go", "token_count": 12720 }
68
// 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. //go:build gccgo #include "_cgo_export.h" #include <stdint.h> #include <stdio.h> #include <stdlib.h> /* Test calling panic from C. This is what SWIG does. *...
go/src/cmd/cgo/internal/test/callback_c_gccgo.c/0
{ "file_path": "go/src/cmd/cgo/internal/test/callback_c_gccgo.c", "repo_id": "go", "token_count": 163 }
69
// 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 cgo && !windows // Issue 18146: pthread_create failure during syscall.Exec. package cgotest import ( "bytes" "crypto/md5" "os" "os/exec" "run...
go/src/cmd/cgo/internal/test/issue18146.go/0
{ "file_path": "go/src/cmd/cgo/internal/test/issue18146.go", "repo_id": "go", "token_count": 1240 }
70
// 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. // It's going to be hard to include a whole real JVM to test this. // So we'll simulate a really easy JVM using just the parts we need. // This is the relevant...
go/src/cmd/cgo/internal/test/issue26213/jni.h/0
{ "file_path": "go/src/cmd/cgo/internal/test/issue26213/jni.h", "repo_id": "go", "token_count": 282 }
71
// 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 cgo // Issue 30527: function call rewriting casts untyped // constants to int because of ":=" usage. package cgotest import "cmd/cgo/internal/test...
go/src/cmd/cgo/internal/test/issue30527.go/0
{ "file_path": "go/src/cmd/cgo/internal/test/issue30527.go", "repo_id": "go", "token_count": 118 }
72
// 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. // Issue 8148. A typedef of an unnamed struct didn't work when used // with an exported Go function. No runtime test; just make sure it // compiles. package ...
go/src/cmd/cgo/internal/test/issue8148.go/0
{ "file_path": "go/src/cmd/cgo/internal/test/issue8148.go", "repo_id": "go", "token_count": 173 }
73
// 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 gc #include "textflag.h" TEXT cas<>(SB),NOSPLIT,$0 MOVW $0xffff0fc0, R15 // R15 is PC TEXT ·RewindAndSetgid(SB),NOSPLIT|NOFRAME,$0-0 // Save lin...
go/src/cmd/cgo/internal/test/issue9400/asm_arm.s/0
{ "file_path": "go/src/cmd/cgo/internal/test/issue9400/asm_arm.s", "repo_id": "go", "token_count": 328 }
74
// 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. package main /* #include <signal.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> // Raise SIGPIPE. static void CRaiseSIGPIPE() { int fds[2]; ...
go/src/cmd/cgo/internal/testcarchive/testdata/libgo2/libgo2.go/0
{ "file_path": "go/src/cmd/cgo/internal/testcarchive/testdata/libgo2/libgo2.go", "repo_id": "go", "token_count": 644 }
75
// 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. #include <signal.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> struct sigaction sa; struct sigaction osa; static void (*ol...
go/src/cmd/cgo/internal/testcarchive/testdata/main_unix.c/0
{ "file_path": "go/src/cmd/cgo/internal/testcarchive/testdata/main_unix.c", "repo_id": "go", "token_count": 573 }
76
// 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. #include <stdint.h> #include <stdio.h> #include <dlfcn.h> int check_int8(void* handle, const char* fname, int8_t want) { int8_t (*fn)(); fn = (int8_t (*)()...
go/src/cmd/cgo/internal/testcshared/testdata/main1.c/0
{ "file_path": "go/src/cmd/cgo/internal/testcshared/testdata/main1.c", "repo_id": "go", "token_count": 717 }
77
// 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. // Issue 14669: test that fails when build with CGO_CFLAGS selecting // optimization. package p /* const int E = 1; typedef struct s { int c; } s; */ ...
go/src/cmd/cgo/internal/testerrors/testdata/issue14669.go/0
{ "file_path": "go/src/cmd/cgo/internal/testerrors/testdata/issue14669.go", "repo_id": "go", "token_count": 136 }
78
program HelloWorldF90 write(*,*) "Hello World!" end program HelloWorldF90
go/src/cmd/cgo/internal/testfortran/testdata/helloworld/helloworld.f90/0
{ "file_path": "go/src/cmd/cgo/internal/testfortran/testdata/helloworld/helloworld.f90", "repo_id": "go", "token_count": 45 }
79
// 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 cgolife // #include "life.h" import "C" import "unsafe" func Run(gen, x, y int, a []int32) { n := make([]int32, x*y) for i := 0; i < gen; i++ { C...
go/src/cmd/cgo/internal/testlife/testdata/life.go/0
{ "file_path": "go/src/cmd/cgo/internal/testlife/testdata/life.go", "repo_id": "go", "token_count": 387 }
80
// 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 main import "plugin" func main() { p, err := plugin.Open("issue24351.so") if err != nil { panic(err) } f, err := p.Lookup("B") if err != nil { ...
go/src/cmd/cgo/internal/testplugin/testdata/issue24351/main.go/0
{ "file_path": "go/src/cmd/cgo/internal/testplugin/testdata/issue24351/main.go", "repo_id": "go", "token_count": 147 }
81
// 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. // This test uses the Pdeathsig field of syscall.SysProcAttr, so it only works // on platforms that support that. //go:build linux || (freebsd && amd64) // sa...
go/src/cmd/cgo/internal/testsanitizers/cc_test.go/0
{ "file_path": "go/src/cmd/cgo/internal/testsanitizers/cc_test.go", "repo_id": "go", "token_count": 5688 }
82
package main import "cmd/cgo/internal/testsanitizers/testdata/asan_linkerx/p" func pstring(s *string) { println(*s) } func main() { all := []*string{ &S1, &S2, &S3, &S4, &S5, &S6, &S7, &S8, &S9, &S10, &p.S1, &p.S2, &p.S3, &p.S4, &p.S5, &p.S6, &p.S7, &p.S8, &p.S9, &p.S10, } for _, ps := range all { pstring(...
go/src/cmd/cgo/internal/testsanitizers/testdata/asan_linkerx/main.go/0
{ "file_path": "go/src/cmd/cgo/internal/testsanitizers/testdata/asan_linkerx/main.go", "repo_id": "go", "token_count": 247 }
83
// 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 main // Test passing C struct to exported Go function. /* #include <stdint.h> #include <stdlib.h> // T is a C struct with alignment padding after b. ...
go/src/cmd/cgo/internal/testsanitizers/testdata/msan7.go/0
{ "file_path": "go/src/cmd/cgo/internal/testsanitizers/testdata/msan7.go", "repo_id": "go", "token_count": 303 }
84
// 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 main // Setting an environment variable in a cgo program changes the C // environment. Test that this does not confuse the race detector. /* #cgo CFLA...
go/src/cmd/cgo/internal/testsanitizers/testdata/tsan7.go/0
{ "file_path": "go/src/cmd/cgo/internal/testsanitizers/testdata/tsan7.go", "repo_id": "go", "token_count": 293 }
85
package main import "testshared/dep3" func main() { dep3.D3() }
go/src/cmd/cgo/internal/testshared/testdata/exe3/exe3.go/0
{ "file_path": "go/src/cmd/cgo/internal/testshared/testdata/exe3/exe3.go", "repo_id": "go", "token_count": 29 }
86
// 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 arm import ( "cmd/compile/internal/ssa" "cmd/compile/internal/ssagen" "cmd/internal/obj/arm" "internal/buildcfg" ) func Init(arch *ssagen.ArchInfo...
go/src/cmd/compile/internal/arm/galign.go/0
{ "file_path": "go/src/cmd/compile/internal/arm/galign.go", "repo_id": "go", "token_count": 241 }
87
// 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 base import ( "fmt" "internal/buildcfg" "internal/types/errors" "os" "runtime/debug" "sort" "strings" "cmd/internal/src" "cmd/internal/teleme...
go/src/cmd/compile/internal/base/print.go/0
{ "file_path": "go/src/cmd/compile/internal/base/print.go", "repo_id": "go", "token_count": 2885 }
88
// 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 escape import ( "fmt" "cmd/compile/internal/base" "cmd/compile/internal/ir" "cmd/compile/internal/logopt" "cmd/compile/internal/typecheck" "cmd/...
go/src/cmd/compile/internal/escape/escape.go/0
{ "file_path": "go/src/cmd/compile/internal/escape/escape.go", "repo_id": "go", "token_count": 5252 }
89
// 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. // This file implements support functionality for iimport.go. package importer import ( "cmd/compile/internal/base" "cmd/compile/internal/types2" "fmt" "g...
go/src/cmd/compile/internal/importer/support.go/0
{ "file_path": "go/src/cmd/compile/internal/importer/support.go", "repo_id": "go", "token_count": 1358 }
90
// 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 inlheur import ( "cmd/compile/internal/base" "cmd/compile/internal/ir" "cmd/compile/internal/types" "fmt" "os" ) // funcFlagsAnalyzer computes th...
go/src/cmd/compile/internal/inline/inlheur/analyze_func_flags.go/0
{ "file_path": "go/src/cmd/compile/internal/inline/inlheur/analyze_func_flags.go", "repo_id": "go", "token_count": 4136 }
91
// 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 inlheur import ( "cmd/compile/internal/ir" "fmt" "os" ) // This file contains code to re-score callsites based on how the // results of the call we...
go/src/cmd/compile/internal/inline/inlheur/score_callresult_uses.go/0
{ "file_path": "go/src/cmd/compile/internal/inline/inlheur/score_callresult_uses.go", "repo_id": "go", "token_count": 4866 }
92
// 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 interleaved implements the interleaved devirtualization and // inlining pass. package interleaved import ( "cmd/compile/internal/base" "cmd/compil...
go/src/cmd/compile/internal/inline/interleaved/interleaved.go/0
{ "file_path": "go/src/cmd/compile/internal/inline/interleaved/interleaved.go", "repo_id": "go", "token_count": 1939 }
93
// 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. //go:build ignore // Note: this program must be run in this directory. // go run mknode.go package main import ( "bytes" "fmt" "go/ast" "go/format" "g...
go/src/cmd/compile/internal/ir/mknode.go/0
{ "file_path": "go/src/cmd/compile/internal/ir/mknode.go", "repo_id": "go", "token_count": 4071 }
94
// 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 liveness import "cmd/compile/internal/bitvec" // FNV-1 hash function constants. const ( h0 = 2166136261 hp = 16777619 ) // bvecSet is a set of bvec...
go/src/cmd/compile/internal/liveness/bvset.go/0
{ "file_path": "go/src/cmd/compile/internal/liveness/bvset.go", "repo_id": "go", "token_count": 910 }
95
// 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 mips64 import ( "cmd/compile/internal/ssa" "cmd/compile/internal/ssagen" "cmd/internal/obj/mips" "internal/buildcfg" ) func Init(arch *ssagen.Arch...
go/src/cmd/compile/internal/mips64/galign.go/0
{ "file_path": "go/src/cmd/compile/internal/mips64/galign.go", "repo_id": "go", "token_count": 284 }
96
// 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 noder import ( "cmd/compile/internal/ir" "cmd/compile/internal/syntax" ) // TODO(mdempsky): Investigate replacing with switch statements or dense ar...
go/src/cmd/compile/internal/noder/stmt.go/0
{ "file_path": "go/src/cmd/compile/internal/noder/stmt.go", "repo_id": "go", "token_count": 220 }
97
// 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 reflectdata_test import ( "testing" ) func BenchmarkEqArrayOfStrings5(b *testing.B) { var a [5]string var c [5]string for i := 0; i < 5; i++ { ...
go/src/cmd/compile/internal/reflectdata/alg_test.go/0
{ "file_path": "go/src/cmd/compile/internal/reflectdata/alg_test.go", "repo_id": "go", "token_count": 1069 }
98
// 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. // Lowering arithmetic (Add(64|32|16|8) ...) => (ADD(Q|L|L|L) ...) (AddPtr ...) => (ADDQ ...) (Add(32|64)F ...) => (ADDS(S|D) ...) (Sub(64|32|16|8) ...) => (SU...
go/src/cmd/compile/internal/ssa/_gen/AMD64.rules/0
{ "file_path": "go/src/cmd/compile/internal/ssa/_gen/AMD64.rules", "repo_id": "go", "token_count": 46999 }
99