- Sort Score
- Result 10 results
- Languages All
Results 141 - 150 of 354 for index (0.06 sec)
-
src/slices/example_test.go
numbers := []int{0, 42, 8} fmt.Println(slices.Index(numbers, 8)) fmt.Println(slices.Index(numbers, 7)) // Output: // 2 // -1 } func ExampleIndexFunc() { numbers := []int{0, 42, -10, 8} i := slices.IndexFunc(numbers, func(n int) bool { return n < 0 }) fmt.Println("First negative at index", i) // Output: // First negative at index 2 } func ExampleInsert() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 10 17:28:50 UTC 2024 - 8.1K bytes - Viewed (0) -
src/go/ast/commentmap.go
fset *token.FileSet list []*CommentGroup index int comment *CommentGroup // comment group at current index pos, end token.Position // source interval of comment group at current index } func (r *commentListReader) eol() bool { return r.index >= len(r.list) } func (r *commentListReader) next() { if !r.eol() { r.comment = r.list[r.index] r.pos = r.fset.Position(r.comment.Pos())
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 8.9K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_cache_interval.go
endIndex int // indexer is meant to inject behaviour for how an event must // be retrieved from the underlying source given an index. indexer indexerFunc // indexValidator is used to check if a given index is still // valid perspective. If it is deemed that the index is not // valid, then this interval can no longer be used to serve // events. Use of indexValidator is warranted only in cases
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Jun 04 09:20:10 UTC 2024 - 8.2K bytes - Viewed (0) -
src/cmd/internal/src/xpos_test.go
} if got := tab.XPos(NoPos); got != NoXPos { t.Errorf("XPos(NoPos): got %v; want %v", got, NoXPos) } if tab.baseList[0] != nil || tab.indexMap[nil] != 0 { t.Errorf("nil base not at index 0") } } func TestSize(t *testing.T) { var p XPos if unsafe.Alignof(p) != 4 { t.Errorf("alignment = %v; want 4", unsafe.Alignof(p)) } if unsafe.Sizeof(p) != 8 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 01 15:52:41 UTC 2023 - 2.7K bytes - Viewed (0) -
cmd/update-notifier_test.go
) // Tests update notifier string builder. func TestPrepareUpdateMessage(t *testing.T) { testCases := []struct { older time.Duration dlURL string expectedSubStr string }{ // Testcase index 0 {72 * time.Hour, "my_download_url", "3 days before the latest release"}, {3 * time.Hour, "https://my_download_url_is_huge/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "3 hours before the latest release"},
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Mon Jul 31 15:36:19 UTC 2023 - 4.1K bytes - Viewed (0) -
src/net/http/filetransport_test.go
t.Errorf("for %s, StatusCode = %d, want 404", badURL, res.StatusCode) } res.Body.Close() } func TestFileTransportFS(t *testing.T) { check := checker(t) fsys := fstest.MapFS{ "index.html": {Data: []byte("index.html says hello")}, } tr := &Transport{} tr.RegisterProtocol("file", NewFileTransportFS(fsys)) c := &Client{Transport: tr} for fname, mfile := range fsys { urlstr := "file:///" + fname
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Aug 07 17:07:12 UTC 2023 - 2.6K bytes - Viewed (0) -
tests/fuzz/aggregate_controller_fuzzer.go
registries := c.GetRegistries() if len(registries) == 0 { return fmt.Errorf("no registries") } index, err := f.GetInt() if err != nil { return err } selectedRegistry := registries[index%len(registries)] c.DeleteRegistry(selectedRegistry.Cluster(), selectedRegistry.Provider()) return nil
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Aug 07 18:40:05 UTC 2023 - 2.7K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/iexport.go
// license that can be found in the LICENSE file. // Indexed package export. // // The indexed export data format is an evolution of the previous // binary export data format. Its chief contribution is introducing an // index table, which allows efficient random access of individual // declarations and inline function bodies. In turn, this allows // avoiding unnecessary work for compilation units that import large // packages. // //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Jul 21 02:40:02 UTC 2023 - 6.8K bytes - Viewed (0) -
src/internal/trace/batchcursor.go
"cmp" "encoding/binary" "fmt" "internal/trace/event" "internal/trace/event/go122" ) type batchCursor struct { m ThreadID lastTs Time idx int // next index into []batch dataOff int // next index into batch.data ev baseEvent // last read event } func (b *batchCursor) nextEvent(batches []batch, freq frequency) (ok bool, err error) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 17 18:48:18 UTC 2024 - 4.1K bytes - Viewed (0) -
src/reflect/deepequal.go
if visited[v] { return true } // Remember for later. visited[v] = true } switch v1.Kind() { case Array: for i := 0; i < v1.Len(); i++ { if !deepValueEqual(v1.Index(i), v2.Index(i), visited) { return false } } return true case Slice: if v1.IsNil() != v2.IsNil() { return false } if v1.Len() != v2.Len() { return false }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:34:30 UTC 2024 - 7.4K bytes - Viewed (0)