repo
stringlengths
6
47
file_url
stringlengths
77
269
file_path
stringlengths
5
186
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-07 08:35:43
2026-01-07 08:55:24
truncated
bool
2 classes
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/pp/printer_test.go
vendor/github.com/yudai/pp/printer_test.go
package pp import ( "fmt" "reflect" "regexp" "strings" "testing" "time" "unsafe" // Use fork until following PR is merged // https://github.com/mitchellh/colorstring/pull/3 "github.com/k0kubun/colorstring" ) type testCase struct { object interface{} expect string } type Foo struct { Bar int Hoge...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/golcs/golcs.go
vendor/github.com/yudai/golcs/golcs.go
// package lcs provides functions to calculate Longest Common Subsequence (LCS) // values from two arbitrary arrays. package lcs import ( "context" "reflect" ) // Lcs is the interface to calculate the LCS of two arrays. type Lcs interface { // Values calculates the LCS value of the two arrays. Values() (values []...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/golcs/golcs_test.go
vendor/github.com/yudai/golcs/golcs_test.go
package lcs import ( "context" "reflect" "testing" "time" ) func TestLCS(t *testing.T) { cases := []struct { left []interface{} right []interface{} indexPairs []IndexPair values []interface{} length int }{ { left: []interface{}{1, 2, 3}, right: []interface{}{2, 3}...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/gojsondiff.go
vendor/github.com/yudai/gojsondiff/gojsondiff.go
// Package gojsondiff implements "Diff" that compares two JSON objects and // generates Deltas that describes differences between them. The package also // provides "Patch" that apply Deltas to a JSON object. package gojsondiff import ( "container/list" "encoding/json" "reflect" "sort" dmp "github.com/sergi/go-d...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/deltas.go
vendor/github.com/yudai/gojsondiff/deltas.go
package gojsondiff import ( "errors" dmp "github.com/sergi/go-diff/diffmatchpatch" "reflect" "strconv" ) // A Delta represents an atomic difference between two JSON objects. type Delta interface { // Similarity calculates the similarity of the Delta values. // The return value is normalized from 0 to 1, // 0 i...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/gojsondiff_suite_test.go
vendor/github.com/yudai/gojsondiff/gojsondiff_suite_test.go
package gojsondiff_test import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "testing" ) func TestGojsondiff(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "Gojsondiff Suite") }
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/gojsondiff_test.go
vendor/github.com/yudai/gojsondiff/gojsondiff_test.go
package gojsondiff_test import ( . "github.com/yudai/gojsondiff" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/yudai/gojsondiff/tests" "io/ioutil" ) var _ = Describe("Gojsondiff", func() { Describe("Differ", func() { Describe("CompareObjects", func() { var ( a, b map[string]i...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/unmarshaler_test.go
vendor/github.com/yudai/gojsondiff/unmarshaler_test.go
package gojsondiff_test import ( . "github.com/yudai/gojsondiff" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/yudai/gojsondiff/tests" "encoding/json" "fmt" "github.com/yudai/pp" ) var _ = Describe("Gojsondiff", func() { Describe("Unmarshaller", func() { Describe("CompareObjects", fu...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/unmarshaler.go
vendor/github.com/yudai/gojsondiff/unmarshaler.go
package gojsondiff import ( "encoding/json" "errors" dmp "github.com/sergi/go-diff/diffmatchpatch" "io" "strconv" ) type Unmarshaller struct { } func NewUnmarshaller() *Unmarshaller { return &Unmarshaller{} } func (um *Unmarshaller) UnmarshalBytes(diffBytes []byte) (Diff, error) { var diffObj map[string]inte...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/formatter/delta.go
vendor/github.com/yudai/gojsondiff/formatter/delta.go
package formatter import ( "encoding/json" "errors" "fmt" diff "github.com/yudai/gojsondiff" ) const ( DeltaDelete = 0 DeltaTextDiff = 2 DeltaMove = 3 ) func NewDeltaFormatter() *DeltaFormatter { return &DeltaFormatter{ PrintIndent: true, } } type DeltaFormatter struct { PrintIndent bool } func ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/formatter/formatter_suite_test.go
vendor/github.com/yudai/gojsondiff/formatter/formatter_suite_test.go
package formatter_test import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "testing" ) func TestFormatter(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "Formatter Suite") }
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/formatter/delta_test.go
vendor/github.com/yudai/gojsondiff/formatter/delta_test.go
package formatter_test import ( . "github.com/yudai/gojsondiff/formatter" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/yudai/gojsondiff/tests" diff "github.com/yudai/gojsondiff" ) var _ = Describe("Delta", func() { Describe("Foramt", func() { var ( a, b map[string]interface{} ) ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/formatter/ascii_test.go
vendor/github.com/yudai/gojsondiff/formatter/ascii_test.go
package formatter_test import ( . "github.com/yudai/gojsondiff/formatter" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/yudai/gojsondiff/tests" diff "github.com/yudai/gojsondiff" ) var _ = Describe("Ascii", func() { Describe("AsciiPrinter", func() { var ( a, b map[string]interface{}...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/formatter/ascii.go
vendor/github.com/yudai/gojsondiff/formatter/ascii.go
package formatter import ( "bytes" "errors" "fmt" "sort" diff "github.com/yudai/gojsondiff" ) func NewAsciiFormatter(left interface{}, config AsciiFormatterConfig) *AsciiFormatter { return &AsciiFormatter{ left: left, config: config, } } type AsciiFormatter struct { left interface{} config AsciiF...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/yudai/gojsondiff/tests/helper.go
vendor/github.com/yudai/gojsondiff/tests/helper.go
package tests import ( . "github.com/onsi/ginkgo" "encoding/json" "io/ioutil" ) func LoadFixture(file string) map[string]interface{} { content, err := ioutil.ReadFile(file) if err != nil { Fail("Fixture file '" + file + "' not found.") } var result map[string]interface{} err = json.Unmarshal(content, &resu...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/jtolds/gls/gid.go
vendor/github.com/jtolds/gls/gid.go
package gls var ( stackTagPool = &idPool{} ) // Will return this goroutine's identifier if set. If you always need a // goroutine identifier, you should use EnsureGoroutineId which will make one // if there isn't one already. func GetGoroutineId() (gid uint, ok bool) { return readStackTag() } // Will call cb with ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/jtolds/gls/stack_tags_js.go
vendor/github.com/jtolds/gls/stack_tags_js.go
// +build js package gls // This file is used for GopherJS builds, which don't have normal runtime // stack trace support import ( "strconv" "strings" "github.com/gopherjs/gopherjs/js" ) const ( jsFuncNamePrefix = "github_com_jtolds_gls_mark" ) func jsMarkStack() (f []uintptr) { lines := strings.Split( js....
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/jtolds/gls/context_test.go
vendor/github.com/jtolds/gls/context_test.go
package gls_test import ( "fmt" "sync" "testing" "github.com/jtolds/gls" ) func TestContexts(t *testing.T) { mgr1 := gls.NewContextManager() mgr2 := gls.NewContextManager() CheckVal := func(mgr *gls.ContextManager, key, exp_val string) { val, ok := mgr.GetValue(key) if len(exp_val) == 0 { if ok { ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/jtolds/gls/stack_tags_main.go
vendor/github.com/jtolds/gls/stack_tags_main.go
// +build !js package gls // This file is used for standard Go builds, which have the expected runtime // support import ( "runtime" ) var ( findPtr = func() uintptr { var pc [1]uintptr n := runtime.Callers(4, pc[:]) if n != 1 { panic("failed to find function pointer") } return pc[0] } getStack = ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/jtolds/gls/gen_sym.go
vendor/github.com/jtolds/gls/gen_sym.go
package gls import ( "sync" ) var ( keyMtx sync.Mutex keyCounter uint64 ) // ContextKey is a throwaway value you can use as a key to a ContextManager type ContextKey struct{ id uint64 } // GenSym will return a brand new, never-before-used ContextKey func GenSym() ContextKey { keyMtx.Lock() defer keyMtx.Unl...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/jtolds/gls/context.go
vendor/github.com/jtolds/gls/context.go
// Package gls implements goroutine-local storage. package gls import ( "sync" ) var ( mgrRegistry = make(map[*ContextManager]bool) mgrRegistryMtx sync.RWMutex ) // Values is simply a map of key types to value types. Used by SetValues to // set multiple values at once. type Values map[interface{}]interface{} ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/jtolds/gls/stack_tags.go
vendor/github.com/jtolds/gls/stack_tags.go
package gls // so, basically, we're going to encode integer tags in base-16 on the stack const ( bitWidth = 4 stackBatchSize = 16 ) var ( pc_lookup = make(map[uintptr]int8, 17) mark_lookup [16]func(uint, func()) ) func init() { setEntries := func(f func(uint, func()), v int8) { var ptr uintptr f(0,...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/jtolds/gls/id_pool.go
vendor/github.com/jtolds/gls/id_pool.go
package gls // though this could probably be better at keeping ids smaller, the goal of // this class is to keep a registry of the smallest unique integer ids // per-process possible import ( "sync" ) type idPool struct { mtx sync.Mutex released []uint max_id uint } func (p *idPool) Acquire() (id uint) {...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/cpuid/mockcpu_test.go
vendor/github.com/klauspost/cpuid/mockcpu_test.go
package cpuid import ( "archive/zip" "fmt" "io/ioutil" "sort" "strings" "testing" ) type fakecpuid map[uint32][][]uint32 type idfuncs struct { cpuid func(op uint32) (eax, ebx, ecx, edx uint32) cpuidex func(op, op2 uint32) (eax, ebx, ecx, edx uint32) xgetbv func(index uint32) (eax, edx uint32) } func (f ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/cpuid/cpuid.go
vendor/github.com/klauspost/cpuid/cpuid.go
// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. // Package cpuid provides information about the CPU running the current program. // // CPU features are detected on startup, and kept for fast access through the life of the application. // Currently x86 / x64 (AMD64) is supported. // // Y...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/cpuid/detect_intel.go
vendor/github.com/klauspost/cpuid/detect_intel.go
// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. // +build 386,!gccgo amd64,!gccgo package cpuid func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) func asmXgetbv(index uint32) (eax, edx uint32) func asmRdtscpAsm() (eax, ebx...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/cpuid/detect_ref.go
vendor/github.com/klauspost/cpuid/detect_ref.go
// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. // +build !amd64,!386 gccgo package cpuid func initCPU() { cpuid = func(op uint32) (eax, ebx, ecx, edx uint32) { return 0, 0, 0, 0 } cpuidex = func(op, op2 uint32) (eax, ebx, ecx, edx uint32) { return 0, 0, 0, 0 } xgetbv = fun...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/cpuid/cpuid_test.go
vendor/github.com/klauspost/cpuid/cpuid_test.go
// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. package cpuid import ( "fmt" "testing" ) // There is no real way to test a CPU identifier, since results will // obviously differ on each machine. func TestCPUID(t *testing.T) { n := maxFunctionID() t.Logf("Max Function:0x%x\n", n) ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/cpuid/generate.go
vendor/github.com/klauspost/cpuid/generate.go
package cpuid //go:generate go run private-gen.go //go:generate gofmt -w ./private
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/cpuid/testdata/getall.go
vendor/github.com/klauspost/cpuid/testdata/getall.go
package main import ( "archive/zip" _ "bytes" "fmt" "golang.org/x/net/html" "io" "net/http" "os" "strings" ) // Download all CPUID dumps from http://users.atw.hu/instlatx64/ func main() { resp, err := http.Get("http://users.atw.hu/instlatx64/?") if err != nil { panic(err) } node, err := html.Parse(resp...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/zlib/writer_test.go
vendor/github.com/klauspost/compress/zlib/writer_test.go
// 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 zlib import ( "bytes" "fmt" "io" "io/ioutil" "os" "testing" ) var filenames = []string{ "../testdata/gettysburg.txt", "../testdata/e.txt", "....
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/zlib/writer.go
vendor/github.com/klauspost/compress/zlib/writer.go
// 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 zlib import ( "fmt" "hash" "hash/adler32" "io" "github.com/klauspost/compress/flate" ) // These constants are copied from the flate package, so ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/zlib/reader.go
vendor/github.com/klauspost/compress/zlib/reader.go
// 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 zlib implements reading and writing of zlib format compressed data, as specified in RFC 1950. The implementation provides filters that uncompress du...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/zlib/reader_test.go
vendor/github.com/klauspost/compress/zlib/reader_test.go
// 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 zlib import ( "bytes" "io" "testing" ) type zlibTest struct { desc string raw string compressed []byte dict []byte err ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/zlib/example_test.go
vendor/github.com/klauspost/compress/zlib/example_test.go
// 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 zlib_test import ( "bytes" "compress/zlib" "fmt" "io" "os" ) func ExampleNewWriter() { var b bytes.Buffer w := zlib.NewWriter(&b) w.Write([]b...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/writer_test.go
vendor/github.com/klauspost/compress/flate/writer_test.go
// 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 flate import ( "bytes" "fmt" "io" "io/ioutil" "math/rand" "runtime" "testing" ) func benchmarkEncoder(b *testing.B, testfile, level, n int) { ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/huffman_bit_writer_test.go
vendor/github.com/klauspost/compress/flate/huffman_bit_writer_test.go
// 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 flate import ( "bytes" "flag" "fmt" "io/ioutil" "os" "path/filepath" "strings" "testing" ) var update = flag.Bool("update", false, "update ref...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
true
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/inflate.go
vendor/github.com/klauspost/compress/flate/inflate.go
// 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 implements the DEFLATE compressed data format, described in // RFC 1951. The gzip and zlib packages implement access to DEFLATE-based file // ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go
vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go
// 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 ( "io" ) const ( // The largest offset code. offsetCodeCount = 30 // The special code used to mark the end of a block. endBlockMark...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/token.go
vendor/github.com/klauspost/compress/flate/token.go
// 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 "fmt" const ( // 2 bits: type 0 = literal 1=EOF 2=Match 3=Unused // 8 bits: xlength = length - MIN_MATCH_LENGTH // 22 bits ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/crc32_noasm.go
vendor/github.com/klauspost/compress/flate/crc32_noasm.go
//+build !amd64 noasm appengine // Copyright 2015, Klaus Post, see LICENSE for details. package flate func init() { useSSE42 = false } // crc32sse should never be called. func crc32sse(a []byte) uint32 { panic("no assembler") } // crc32sseAll should never be called. func crc32sseAll(a []byte, dst []uint32) { pa...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/deflate_test.go
vendor/github.com/klauspost/compress/flate/deflate_test.go
// Copyright 2009 The Go Authors. All rights reserved. // Copyright (c) 2015 Klaus Post // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package flate import ( "bytes" "fmt" "io" "io/ioutil" "reflect" "strings" "sync" "testing" ) type deflateTest struct ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/deflate.go
vendor/github.com/klauspost/compress/flate/deflate.go
// Copyright 2009 The Go Authors. All rights reserved. // Copyright (c) 2015 Klaus Post // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package flate import ( "fmt" "io" "math" ) const ( NoCompression = 0 BestSpeed = 1 BestCompression = 9...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
true
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/asm_test.go
vendor/github.com/klauspost/compress/flate/asm_test.go
// Copyright 2015, Klaus Post, see LICENSE for details. //+build amd64 package flate import ( "math/rand" "testing" ) func TestCRC(t *testing.T) { if !useSSE42 { t.Skip("Skipping CRC test, no SSE 4.2 available") } for _, x := range deflateTests { y := x.out if len(y) >= minMatchLength { t.Logf("In: %v...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/reader_test.go
vendor/github.com/klauspost/compress/flate/reader_test.go
// 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 flate import ( "bytes" "io" "io/ioutil" "runtime" "strings" "testing" ) func TestNlitOutOfRange(t *testing.T) { // Trying to decode this bogus ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/copy.go
vendor/github.com/klauspost/compress/flate/copy.go
// 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 flate // forwardCopy is like the built-in copy function except that it always goes // forward from the start, even if the dst and src overlap. // It is...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/crc32_amd64.go
vendor/github.com/klauspost/compress/flate/crc32_amd64.go
//+build !noasm //+build !appengine // Copyright 2015, Klaus Post, see LICENSE for details. package flate import ( "github.com/klauspost/cpuid" ) // crc32sse returns a hash for the first 4 bytes of the slice // len(a) must be >= 4. //go:noescape func crc32sse(a []byte) uint32 // crc32sseAll calculates hashes for ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/inflate_test.go
vendor/github.com/klauspost/compress/flate/inflate_test.go
// 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 flate import ( "bytes" "crypto/rand" "io" "io/ioutil" "strconv" "strings" "testing" ) func TestReset(t *testing.T) { ss := []string{ "lorem ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/reverse_bits.go
vendor/github.com/klauspost/compress/flate/reverse_bits.go
// 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 var reverseByte = [256]byte{ 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48,...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/huffman_code.go
vendor/github.com/klauspost/compress/flate/huffman_code.go
// 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 ( "math" "sort" ) // hcode is a huffman code with a bit code and bit length. type hcode struct { code, len uint16 } type huffmanEncod...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/dict_decoder_test.go
vendor/github.com/klauspost/compress/flate/dict_decoder_test.go
// 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 flate import ( "bytes" "strings" "testing" ) func TestDictDecoder(t *testing.T) { const ( abc = "ABC\n" fox = "The quick brown fox jumped ov...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/dict_decoder.go
vendor/github.com/klauspost/compress/flate/dict_decoder.go
// 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 flate // dictDecoder implements the LZ77 sliding dictionary as used in decompression. // LZ77 decompresses data through sequences of two forms of comma...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/flate_test.go
vendor/github.com/klauspost/compress/flate/flate_test.go
// 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. // This test tests some internals of the flate package. // The tests in package compress/gzip serve as the // end-to-end test of the decompressor. package flat...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/copy_test.go
vendor/github.com/klauspost/compress/flate/copy_test.go
// 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 flate import ( "testing" ) func TestForwardCopy(t *testing.T) { testCases := []struct { dst0, dst1 int src0, src1 int want string }{ ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/flate/snappy.go
vendor/github.com/klauspost/compress/flate/snappy.go
// Copyright 2011 The Snappy-Go Authors. All rights reserved. // Modified for deflate by Klaus Post (c) 2015. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package flate // emitLiteral writes a literal chunk and returns the number of bytes written. func emitLi...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/gzip/gzip_test.go
vendor/github.com/klauspost/compress/gzip/gzip_test.go
// 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 gzip import ( "bufio" "bytes" oldgz "compress/gzip" "io" "io/ioutil" "math/rand" "testing" "time" ) // TestEmpty tests that an empty payload s...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/gzip/gzip.go
vendor/github.com/klauspost/compress/gzip/gzip.go
// 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 gzip import ( "errors" "fmt" "hash/crc32" "io" "github.com/klauspost/compress/flate" ) // These constants are copied from the flate package, so ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/gzip/gunzip_test.go
vendor/github.com/klauspost/compress/gzip/gunzip_test.go
// 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 gzip import ( "bytes" oldgz "compress/gzip" "crypto/rand" "io" "io/ioutil" "os" "strings" "testing" "time" "github.com/klauspost/compress/fl...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/gzip/example_test.go
vendor/github.com/klauspost/compress/gzip/example_test.go
// 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 gzip_test import ( "bytes" "compress/gzip" "fmt" "io" "log" "os" "time" ) func Example_writerReader() { var buf bytes.Buffer zw := gzip.NewWr...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/klauspost/compress/gzip/gunzip.go
vendor/github.com/klauspost/compress/gzip/gunzip.go
// 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 gzip implements reading and writing of gzip format compressed files, // as specified in RFC 1952. package gzip import ( "bufio" "encoding/binary" ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/gopherjs/gopherjs/js/js.go
vendor/github.com/gopherjs/gopherjs/js/js.go
// Package js provides functions for interacting with native JavaScript APIs. Calls to these functions are treated specially by GopherJS and translated directly to their corresponding JavaScript syntax. // // Use MakeWrapper to expose methods to JavaScript. When passing values directly, the following type conversions a...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/imkira/go-interpol/io_test.go
vendor/github.com/imkira/go-interpol/io_test.go
package interpol import ( "bytes" "io" ) type errRWFunc func(b []byte) (int, error) type errRW struct { xn int n int err error } func (rw *errRW) do(f errRWFunc, b []byte) (int, error) { var tn int for i := 0; i < len(b); i++ { if rw.n >= rw.xn { return tn, rw.err } n, err := f(b[i : i+1]) if e...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/imkira/go-interpol/interpol_test.go
vendor/github.com/imkira/go-interpol/interpol_test.go
package interpol import ( "bytes" "errors" "io" "strings" "testing" ) var errDummy = errors.New("dummy") func toError(key string, w io.Writer) error { return errDummy } func toUpper(key string, w io.Writer) error { _, err := w.Write([]byte(strings.ToUpper(key))) return err } func toNull(key string, w io.Wr...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/imkira/go-interpol/io.go
vendor/github.com/imkira/go-interpol/io.go
package interpol import ( "bufio" "io" "unicode/utf8" ) type runeWriter interface { io.Writer WriteRune(r rune) (int, error) } func templateReader(opts *Options) io.RuneReader { if rr, ok := opts.Template.(io.RuneReader); ok { return rr } return bufio.NewReaderSize(opts.Template, utf8.UTFMax) } func outpu...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/imkira/go-interpol/options_test.go
vendor/github.com/imkira/go-interpol/options_test.go
package interpol import ( "bytes" "io" "strings" "testing" ) func TestOptions(t *testing.T) { n := 0 format := func(key string, w io.Writer) error { n++ return nil } opts := &Options{ Template: strings.NewReader("foo"), Format: format, Output: bytes.NewBuffer(nil), } opts2 := []Option{ WithT...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/imkira/go-interpol/options.go
vendor/github.com/imkira/go-interpol/options.go
package interpol import "io" // Options contains all options supported by an Interpolator. type Options struct { Template io.Reader Format Func Output io.Writer } // Option is an option that can be applied to an Interpolator. type Option func(OptionSetter) // OptionSetter is an interface that contains the se...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/imkira/go-interpol/interpol.go
vendor/github.com/imkira/go-interpol/interpol.go
// Package interpol provides utility functions for doing format-string like // string interpolation using named parameters. // Currently, a template only accepts variable placeholders delimited by brace // characters (eg. "Hello {foo} {bar}"). package interpol import ( "bytes" "errors" "io" "strings" ) // Errors ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/bytebufferpool/bytebuffer_timing_test.go
vendor/github.com/valyala/bytebufferpool/bytebuffer_timing_test.go
package bytebufferpool import ( "bytes" "testing" ) func BenchmarkByteBufferWrite(b *testing.B) { s := []byte("foobarbaz") b.RunParallel(func(pb *testing.PB) { var buf ByteBuffer for pb.Next() { for i := 0; i < 100; i++ { buf.Write(s) } buf.Reset() } }) } func BenchmarkBytesBufferWrite(b *tes...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/bytebufferpool/pool_test.go
vendor/github.com/valyala/bytebufferpool/pool_test.go
package bytebufferpool import ( "math/rand" "testing" "time" ) func TestIndex(t *testing.T) { testIndex(t, 0, 0) testIndex(t, 1, 0) testIndex(t, minSize-1, 0) testIndex(t, minSize, 0) testIndex(t, minSize+1, 1) testIndex(t, 2*minSize-1, 1) testIndex(t, 2*minSize, 1) testIndex(t, 2*minSize+1, 2) testInd...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/bytebufferpool/bytebuffer_test.go
vendor/github.com/valyala/bytebufferpool/bytebuffer_test.go
package bytebufferpool import ( "bytes" "fmt" "io" "testing" "time" ) func TestByteBufferReadFrom(t *testing.T) { prefix := "foobar" expectedS := "asadfsdafsadfasdfisdsdfa" prefixLen := int64(len(prefix)) expectedN := int64(len(expectedS)) var bb ByteBuffer bb.WriteString(prefix) rf := (io.ReaderFrom)(&...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/bytebufferpool/bytebuffer_example_test.go
vendor/github.com/valyala/bytebufferpool/bytebuffer_example_test.go
package bytebufferpool_test import ( "fmt" "github.com/valyala/bytebufferpool" ) func ExampleByteBuffer() { bb := bytebufferpool.Get() bb.WriteString("first line\n") bb.Write([]byte("second line\n")) bb.B = append(bb.B, "third line\n"...) fmt.Printf("bytebuffer contents=%q", bb.B) // It is safe to release...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/bytebufferpool/pool.go
vendor/github.com/valyala/bytebufferpool/pool.go
package bytebufferpool import ( "sort" "sync" "sync/atomic" ) const ( minBitSize = 6 // 2**6=64 is a CPU cache line size steps = 20 minSize = 1 << minBitSize maxSize = 1 << (minBitSize + steps - 1) calibrateCallsThreshold = 42000 maxPercentile = 0.95 ) // Pool represents byte buffer pool. /...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/bytebufferpool/bytebuffer.go
vendor/github.com/valyala/bytebufferpool/bytebuffer.go
package bytebufferpool import "io" // ByteBuffer provides byte buffer, which can be used for minimizing // memory allocations. // // ByteBuffer may be used with functions appending data to the given []byte // slice. See example code for details. // // Use Get for obtaining an empty byte buffer. type ByteBuffer struct...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/bytebufferpool/doc.go
vendor/github.com/valyala/bytebufferpool/doc.go
// Package bytebufferpool implements a pool of byte buffers // with anti-fragmentation protection. // // The pool may waste limited amount of memory due to fragmentation. // This amount equals to the maximum total size of the byte buffers // in concurrent use. package bytebufferpool
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/userdata_timing_test.go
vendor/github.com/valyala/fasthttp/userdata_timing_test.go
package fasthttp import ( "testing" ) func BenchmarkUserDataCustom(b *testing.B) { keys := []string{"foobar", "baz", "aaa", "bsdfs"} b.RunParallel(func(pb *testing.PB) { var u userData var v interface{} = u for pb.Next() { for _, key := range keys { u.Set(key, v) } for _, key := range keys { ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/bytebuffer_timing_test.go
vendor/github.com/valyala/fasthttp/bytebuffer_timing_test.go
package fasthttp import ( "bytes" "testing" ) func BenchmarkByteBufferWrite(b *testing.B) { s := []byte("foobarbaz") b.RunParallel(func(pb *testing.PB) { var buf ByteBuffer for pb.Next() { for i := 0; i < 100; i++ { buf.Write(s) } buf.Reset() } }) } func BenchmarkBytesBufferWrite(b *testing.B...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/userdata_test.go
vendor/github.com/valyala/fasthttp/userdata_test.go
package fasthttp import ( "fmt" "reflect" "testing" ) func TestUserData(t *testing.T) { var u userData for i := 0; i < 10; i++ { key := []byte(fmt.Sprintf("key_%d", i)) u.SetBytes(key, i+5) testUserDataGet(t, &u, key, i+5) u.SetBytes(key, i) testUserDataGet(t, &u, key, i) } for i := 0; i < 10; i++ ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/compress.go
vendor/github.com/valyala/fasthttp/compress.go
package fasthttp import ( "bytes" "fmt" "io" "os" "sync" "github.com/klauspost/compress/flate" "github.com/klauspost/compress/gzip" "github.com/klauspost/compress/zlib" "github.com/valyala/bytebufferpool" "github.com/valyala/fasthttp/stackless" ) // Supported compression levels. const ( CompressNoCompress...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/workerpool.go
vendor/github.com/valyala/fasthttp/workerpool.go
package fasthttp import ( "net" "runtime" "strings" "sync" "time" ) // workerPool serves incoming connections via a pool of workers // in FILO order, i.e. the most recently stopped worker will serve the next // incoming connection. // // Such a scheme keeps CPU caches hot (in theory). type workerPool struct { /...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/fs_example_test.go
vendor/github.com/valyala/fasthttp/fs_example_test.go
package fasthttp_test import ( "log" "github.com/valyala/fasthttp" ) func ExampleFS() { fs := &fasthttp.FS{ // Path to directory to serve. Root: "/var/www/static-site", // Generate index pages if client requests directory contents. GenerateIndexPages: true, // Enable transparent compression to save ne...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/cookie_test.go
vendor/github.com/valyala/fasthttp/cookie_test.go
package fasthttp import ( "strings" "testing" "time" ) func TestCookieValueWithEqualAndSpaceChars(t *testing.T) { testCookieValueWithEqualAndSpaceChars(t, "sth1", "/", "MTQ2NjU5NTcwN3xfUVduVXk4aG9jSmZaNzNEb1dGa1VjekY1bG9vMmxSWlJBZUN2Q1ZtZVFNMTk2YU9YaWtCVmY1eDRWZXd3M3Q5RTJRZnZMbk5mWklSSFZJcVlXTDhiSFFHWWdpdFVLd1hwb...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/status.go
vendor/github.com/valyala/fasthttp/status.go
package fasthttp import ( "fmt" "sync/atomic" ) // HTTP status codes were stolen from net/http. const ( StatusContinue = 100 // RFC 7231, 6.2.1 StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2 StatusProcessing = 102 // RFC 2518, 10.1 StatusOK = 200 // RFC 7231, 6.3.1 Statu...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/peripconn.go
vendor/github.com/valyala/fasthttp/peripconn.go
package fasthttp import ( "fmt" "net" "sync" ) type perIPConnCounter struct { pool sync.Pool lock sync.Mutex m map[uint32]int } func (cc *perIPConnCounter) Register(ip uint32) int { cc.lock.Lock() if cc.m == nil { cc.m = make(map[uint32]int) } n := cc.m[ip] + 1 cc.m[ip] = n cc.lock.Unlock() return ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/client.go
vendor/github.com/valyala/fasthttp/client.go
package fasthttp import ( "bufio" "bytes" "crypto/tls" "errors" "fmt" "io" "net" "strings" "sync" "sync/atomic" "time" ) // Do performs the given http request and fills the given http response. // // Request must contain at least non-zero RequestURI with full url (including // scheme and host) or non-zero ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
true
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/stream.go
vendor/github.com/valyala/fasthttp/stream.go
package fasthttp import ( "bufio" "io" "sync" "github.com/valyala/fasthttp/fasthttputil" ) // StreamWriter must write data to w. // // Usually StreamWriter writes data to w in a loop (aka 'data streaming'). // // StreamWriter must return immediately if w returns error. // // Since the written data is buffered, d...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/uri.go
vendor/github.com/valyala/fasthttp/uri.go
package fasthttp import ( "bytes" "io" "sync" ) // AcquireURI returns an empty URI instance from the pool. // // Release the URI with ReleaseURI after the URI is no longer needed. // This allows reducing GC load. func AcquireURI() *URI { return uriPool.Get().(*URI) } // ReleaseURI releases the URI acquired via A...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/client_example_test.go
vendor/github.com/valyala/fasthttp/client_example_test.go
package fasthttp_test import ( "log" "github.com/valyala/fasthttp" ) func ExampleHostClient() { // Perpare a client, which fetches webpages via HTTP proxy listening // on the localhost:8080. c := &fasthttp.HostClient{ Addr: "localhost:8080", } // Fetch google page via local proxy. statusCode, body, err :=...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/requestctx_setbodystreamwriter_example_test.go
vendor/github.com/valyala/fasthttp/requestctx_setbodystreamwriter_example_test.go
package fasthttp_test import ( "bufio" "fmt" "log" "time" "github.com/valyala/fasthttp" ) func ExampleRequestCtx_SetBodyStreamWriter() { // Start fasthttp server for streaming responses. if err := fasthttp.ListenAndServe(":8080", responseStreamHandler); err != nil { log.Fatalf("unexpected error in server: %...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/coarseTime_test.go
vendor/github.com/valyala/fasthttp/coarseTime_test.go
package fasthttp import ( "sync/atomic" "testing" "time" ) func BenchmarkCoarseTimeNow(b *testing.B) { var zeroTimeCount uint64 b.RunParallel(func(pb *testing.PB) { for pb.Next() { t := CoarseTimeNow() if t.IsZero() { atomic.AddUint64(&zeroTimeCount, 1) } } }) if zeroTimeCount > 0 { b.Fatalf...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/uri_unix.go
vendor/github.com/valyala/fasthttp/uri_unix.go
// +build !windows package fasthttp func addLeadingSlash(dst, src []byte) []byte { // add leading slash for unix paths if len(src) == 0 || src[0] != '/' { dst = append(dst, '/') } return dst }
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/workerpool_test.go
vendor/github.com/valyala/fasthttp/workerpool_test.go
package fasthttp import ( "io/ioutil" "net" "testing" "time" "github.com/valyala/fasthttp/fasthttputil" ) func TestWorkerPoolStartStopSerial(t *testing.T) { testWorkerPoolStartStop(t) } func TestWorkerPoolStartStopConcurrent(t *testing.T) { concurrency := 10 ch := make(chan struct{}, concurrency) for i := ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/timer.go
vendor/github.com/valyala/fasthttp/timer.go
package fasthttp import ( "sync" "time" ) func initTimer(t *time.Timer, timeout time.Duration) *time.Timer { if t == nil { return time.NewTimer(timeout) } if t.Reset(timeout) { panic("BUG: active timer trapped into initTimer()") } return t } func stopTimer(t *time.Timer) { if !t.Stop() { // Collect pos...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/server_test.go
vendor/github.com/valyala/fasthttp/server_test.go
package fasthttp import ( "bufio" "bytes" "crypto/tls" "fmt" "io" "io/ioutil" "net" "os" "strings" "sync" "testing" "time" "github.com/valyala/fasthttp/fasthttputil" ) func TestRequestCtxString(t *testing.T) { var ctx RequestCtx s := ctx.String() expectedS := "#0000000000000000 - 0.0.0.0:0<->0.0.0.0...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
true
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/bytesconv_64_test.go
vendor/github.com/valyala/fasthttp/bytesconv_64_test.go
// +build amd64 arm64 ppc64 package fasthttp import ( "testing" ) func TestWriteHexInt(t *testing.T) { testWriteHexInt(t, 0, "0") testWriteHexInt(t, 1, "1") testWriteHexInt(t, 0x123, "123") testWriteHexInt(t, 0x7fffffffffffffff, "7fffffffffffffff") } func TestAppendUint(t *testing.T) { testAppendUint(t, 0) t...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/uri_windows.go
vendor/github.com/valyala/fasthttp/uri_windows.go
// +build windows package fasthttp func addLeadingSlash(dst, src []byte) []byte { // zero length and "C:/" case if len(src) == 0 || (len(src) > 2 && src[1] != ':') { dst = append(dst, '/') } return dst }
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/bytebuffer_test.go
vendor/github.com/valyala/fasthttp/bytebuffer_test.go
package fasthttp import ( "fmt" "testing" "time" ) func TestByteBufferAcquireReleaseSerial(t *testing.T) { testByteBufferAcquireRelease(t) } func TestByteBufferAcquireReleaseConcurrent(t *testing.T) { concurrency := 10 ch := make(chan struct{}, concurrency) for i := 0; i < concurrency; i++ { go func() { ...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/bytesconv_32_test.go
vendor/github.com/valyala/fasthttp/bytesconv_32_test.go
// +build !amd64,!arm64,!ppc64 package fasthttp import ( "testing" ) func TestWriteHexInt(t *testing.T) { testWriteHexInt(t, 0, "0") testWriteHexInt(t, 1, "1") testWriteHexInt(t, 0x123, "123") testWriteHexInt(t, 0x7fffffff, "7fffffff") } func TestAppendUint(t *testing.T) { testAppendUint(t, 0) testAppendUint...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/bytebuffer_example_test.go
vendor/github.com/valyala/fasthttp/bytebuffer_example_test.go
package fasthttp_test import ( "fmt" "github.com/valyala/fasthttp" ) func ExampleByteBuffer() { // This request handler sets 'Your-IP' response header // to 'Your IP is <ip>'. It uses ByteBuffer for constructing response // header value with zero memory allocations. yourIPRequestHandler := func(ctx *fasthttp.R...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/server_timing_test.go
vendor/github.com/valyala/fasthttp/server_timing_test.go
package fasthttp import ( "bytes" "fmt" "io" "io/ioutil" "net" "net/http" "runtime" "sync" "sync/atomic" "testing" "time" ) var defaultClientsCount = runtime.NumCPU() func BenchmarkRequestCtxRedirect(b *testing.B) { b.RunParallel(func(pb *testing.PB) { var ctx RequestCtx for pb.Next() { ctx.Reques...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false
erikvanbrakel/anthology
https://github.com/erikvanbrakel/anthology/blob/c715d868faa4799678792337e5f86725ceffd797/vendor/github.com/valyala/fasthttp/client_test.go
vendor/github.com/valyala/fasthttp/client_test.go
package fasthttp import ( "bufio" "crypto/tls" "fmt" "io" "net" "os" "runtime" "strings" "sync" "sync/atomic" "testing" "time" "github.com/valyala/fasthttp/fasthttputil" ) func TestClientDoWithCustomHeaders(t *testing.T) { // make sure that the client sends all the request headers and body. ln := fast...
go
MIT
c715d868faa4799678792337e5f86725ceffd797
2026-01-07T09:45:51.510322Z
false