- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 546 for Map (0.18 sec)
-
src/maps/iter.go
// to be the same from one call to the next. func Values[Map ~map[K]V, K comparable, V any](m Map) iter.Seq[V] { return func(yield func(V) bool) { for _, v := range m { if !yield(v) { return } } } } // Insert adds the key-value pairs from seq to m. // If a key in seq already exists in m, its value will be overwritten. func Insert[Map ~map[K]V, K comparable, V any](m Map, seq iter.Seq2[K, V]) { for k, v := range seq {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 13:41:45 UTC 2024 - 1.6K bytes - Viewed (0) -
src/internal/types/testdata/check/cycles0.go
i0 /* ERROR "invalid recursive type: i0 refers to itself" */ interface{ i0 } // maps m0 map[m0 /* ERROR "invalid map key" */ ]m0 // channels c0 chan c0 ) } // test cases for issue 6667 type A [10]map[A /* ERROR "invalid map key" */ ]bool type S struct { m map[S /* ERROR "invalid map key" */ ]bool } // test cases for issue 7236
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jan 17 19:54:25 UTC 2023 - 3.6K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/facts/imports.go
) // importMap computes the import map for a package by traversing the // entire exported API each of its imports. // // This is a workaround for the fact that we cannot access the map used // internally by the types.Importer returned by go/importer. The entries // in this map are the packages and objects that may be relevant to the // current analysis unit. // // Packages in the map that are only indirectly imported may be
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 3.5K bytes - Viewed (0) -
test/fixedbugs/issue63505.go
package main type explainer struct { m map[string]string } func init() { RegisterExplainer(newExplainer()) } type Explainer interface { Name() string Map() map[string]string } func (e explainer) Name() string { return "HelloWorldExplainer" } func (e explainer) Map() map[string]string { return e.m } //go:noinline func newExplainer() explainer {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 12 00:48:31 UTC 2023 - 736 bytes - Viewed (0) -
src/reflect/deepequal.go
// Visited comparisons are stored in a map indexed by visit. type visit struct { a1 unsafe.Pointer a2 unsafe.Pointer typ Type } // Tests for deep equality using reflected types. The map argument tracks // comparisons that have already been seen, which allows short circuiting on // recursive types. func deepValueEqual(v1, v2 Value, visited map[visit]bool) bool { if !v1.IsValid() || !v2.IsValid() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:34:30 UTC 2024 - 7.4K bytes - Viewed (0) -
src/testing/slogtest/example_test.go
// format when given a pointer to a map[string]any. func Example_parsing() { var buf bytes.Buffer h := slog.NewJSONHandler(&buf, nil) results := func() []map[string]any { var ms []map[string]any for _, line := range bytes.Split(buf.Bytes(), []byte{'\n'}) { if len(line) == 0 { continue } var m map[string]any if err := json.Unmarshal(line, &m); err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 04 18:32:54 UTC 2023 - 1.1K bytes - Viewed (0) -
src/unique/handle.go
toInsertWeak = weak.Make(toInsert) } return toInsertWeak } var ptr *T for { // Check the map. wp, ok := m.Load(value) if !ok { // Try to insert a new value into the map. wp, _ = m.LoadOrStore(value, newValue()) } // Now that we're sure there's a value in the map, let's // try to get the pointer we need out of it. ptr = wp.Strong() if ptr != nil { break }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 16:01:55 UTC 2024 - 5.3K bytes - Viewed (0) -
src/internal/types/testdata/fixedbugs/issue50755.go
// during constraint type inference. func f4[M4 map[K4]int, K4 comparable](m4 M4) {} func f5[M5 map[K5]int, K5 comparable](m5 M5) { f4(m5) } // test case from issue func Copy[MC ~map[KC]VC, KC comparable, VC any](dst, src MC) { for k, v := range src { dst[k] = v } } func Merge[MM ~map[KM]VM, KM comparable, VM any](ms ...MM) MM { result := MM{} for _, m := range ms { Copy(result, m) } return result
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 02 02:58:32 UTC 2022 - 1K bytes - Viewed (0) -
src/sync/map_reference_test.go
} func (m *DeepCopyMap) Range(f func(key, value any) (shouldContinue bool)) { clean, _ := m.clean.Load().(map[any]any) for k, v := range clean { if !f(k, v) { break } } } func (m *DeepCopyMap) dirty() map[any]any { clean, _ := m.clean.Load().(map[any]any) dirty := make(map[any]any, len(clean)+1) for k, v := range clean { dirty[k] = v } return dirty }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 01 15:34:22 UTC 2024 - 5.6K bytes - Viewed (0) -
test/fixedbugs/notinheap.go
// Test type-checking errors for go:notinheap. package p //go:notinheap type nih struct{} type embed4 map[nih]int // ERROR "incomplete \(or unallocatable\) map key not allowed" type embed5 map[int]nih // ERROR "incomplete \(or unallocatable\) map value not allowed" type emebd6 chan nih // ERROR "chan of incomplete \(or unallocatable\) type not allowed" type okay1 *nih type okay2 []nih
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 02 17:46:15 UTC 2022 - 1.3K bytes - Viewed (0)