- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for sortBy (0.17 sec)
-
src/archive/zip/reader.go
return &files[i] } } return nil } func (r *Reader) openReadDir(dir string) []fileListEntry { files := r.fileList i := sort.Search(len(files), func(i int) bool { idir, _, _ := split(files[i].name) return idir >= dir }) j := sort.Search(len(files), func(j int) bool { jdir, _, _ := split(files[j].name) return jdir > dir }) return files[i:j] } type openDir struct {
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Oct 13 18:36:46 GMT 2023 - 27.7K bytes - Viewed (0) -
src/bytes/example_test.go
} if !bytes.Equal(a, b) { // a not equal b } } func ExampleCompare_search() { // Binary search to find a matching byte slice. var needle []byte var haystack [][]byte // Assume sorted i := sort.Search(len(haystack), func(i int) bool { // Return haystack[i] >= needle. return bytes.Compare(haystack[i], needle) >= 0 }) if i < len(haystack) && bytes.Equal(haystack[i], needle) { // Found it! }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Mon Mar 04 15:54:40 GMT 2024 - 15K bytes - Viewed (1) -
src/archive/tar/writer.go
*/ _ = realSize // Write PAX records to the output. isGlobal := hdr.Typeflag == TypeXGlobalHeader if len(paxHdrs) > 0 || isGlobal { // Sort keys for deterministic ordering. var keys []string for k := range paxHdrs { keys = append(keys, k) } sort.Strings(keys) // Write each record to a buffer. var buf strings.Builder for _, k := range keys { rec, err := formatPAXRecord(k, paxHdrs[k])
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Oct 13 18:36:46 GMT 2023 - 19.6K bytes - Viewed (0) -
src/archive/zip/zip_test.go
// license that can be found in the LICENSE file. // Tests that involve both reading and writing. package zip import ( "bytes" "errors" "fmt" "hash" "internal/testenv" "io" "runtime" "sort" "strings" "testing" "time" ) func TestOver65kFiles(t *testing.T) { if testing.Short() && testenv.Builder() == "" { t.Skip("skipping in short mode") } buf := new(strings.Builder)
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Mar 27 18:23:49 GMT 2024 - 19.5K bytes - Viewed (0) -
src/cmd/api/api_test.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "flag" "fmt" "go/build" "internal/testenv" "os" "path/filepath" "sort" "strings" "sync" "testing" ) var flagCheck = flag.Bool("check", false, "run API checks") func TestMain(m *testing.M) { flag.Parse() for _, c := range contexts {
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Thu Jan 04 17:31:12 GMT 2024 - 7.1K bytes - Viewed (0) -
src/cmd/cgo/internal/test/issue1435.go
} if filter == "Groups:" && strings.HasPrefix(line, "Groups:\t") { // https://github.com/golang/go/issues/46145 // Containers don't reliably output this line in sorted order so manually sort and compare that. a := strings.Split(line[8:], " ") sort.Strings(a) got := strings.Join(a, " ") if got == expected[8:] { foundAThread = true break } }
Go - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Fri Jul 28 21:31:41 GMT 2023 - 7.5K bytes - Viewed (0) -
src/cmd/asm/internal/asm/endtoend_test.go
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Thu Dec 07 18:42:59 GMT 2023 - 11.6K bytes - Viewed (0) -
src/cmd/api/main_test.go
} func compareAPI(w io.Writer, features, required, exception []string) (ok bool) { ok = true featureSet := set(features) exceptionSet := set(exception) sort.Strings(features) sort.Strings(required) take := func(sl *[]string) string { s := (*sl)[0] *sl = (*sl)[1:] return s } for len(features) > 0 || len(required) > 0 { switch {
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Apr 09 20:48:51 GMT 2024 - 31.4K bytes - Viewed (0) -
src/archive/tar/writer_test.go
bytes.Index(buf.Bytes(), []byte("baz=baz")), bytes.Index(buf.Bytes(), []byte("foo=foo")), bytes.Index(buf.Bytes(), []byte("qux=qux")), } if !sort.IntsAreSorted(indices) { t.Fatal("PAX headers are not sorted") } } func TestUSTARLongName(t *testing.T) { // Create an archive with a path that failed to split with USTAR extension in previous versions.
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Feb 27 16:39:23 GMT 2024 - 38.7K bytes - Viewed (0) -
src/archive/tar/reader.go
// Do this because Seek is often lazy about reporting errors; this will mask // the fact that the stream may be truncated. We can rely on the // io.CopyN done shortly afterwards to trigger any IO errors. var seekSkipped int64 // Number of bytes skipped via Seek if sr, ok := r.(io.Seeker); ok && n > 1 { // Not all io.Seeker can actually Seek. For example, os.Stdin implements
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Mar 08 01:59:14 GMT 2024 - 26.8K bytes - Viewed (0)