Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 675 for Map (0.06 sec)

  1. src/log/slog/slogtest_test.go

    		m := top
    		for _, key := range keys[:len(keys)-1] {
    			x, ok := m[key]
    			var m2 map[string]any
    			if !ok {
    				m2 = map[string]any{}
    				m[key] = m2
    			} else {
    				m2, ok = x.(map[string]any)
    				if !ok {
    					return nil, fmt.Errorf("value for %q in composite key %q is not map[string]any", key, k)
    
    				}
    			}
    			m = m2
    		}
    		m[keys[len(keys)-1]] = value
    		s = rest
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 10 12:50:22 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  2. test/typeparam/orderedmapsimp.dir/a.go

    // > 0 if the first is greater.
    func New[K, V any](compare func(K, K) int) *Map[K, V] {
    	return &Map[K, V]{compare: compare}
    }
    
    // NewOrdered returns a new map whose key is an ordered type.
    // This is like New, but does not require providing a compare function.
    // The map compare function uses the obvious key ordering.
    func NewOrdered[K Ordered, V any]() *Map[K, V] {
    	return New[K, V](func(k1, k2 K) int {
    		switch {
    		case k1 < k2:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 28 21:40:40 UTC 2021
    - 5.5K bytes
    - Viewed (0)
  3. src/cmd/go/internal/imports/tags.go

    	}
    	return tags
    }
    
    var (
    	anyTags     map[string]bool
    	anyTagsOnce sync.Once
    )
    
    // AnyTags returns a special set of build tags that satisfy nearly all
    // build tag expressions. Only "ignore" and malformed build tag requirements
    // are considered false.
    func AnyTags() map[string]bool {
    	anyTagsOnce.Do(func() {
    		anyTags = map[string]bool{"*": true}
    	})
    	return anyTags
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 26 17:43:59 UTC 2022
    - 1.3K bytes
    - Viewed (0)
  4. src/internal/types/testdata/check/builtins1.go

    // delete
    
    type M0 interface{ int }
    type M1 interface{ map[string]int }
    type M2 interface { map[string]int | map[string]float64 }
    type M3 interface{ map[string]int | map[rune]int }
    type M4[K comparable, V any] interface{ map[K]V | map[rune]V }
    
    func _[T any](m T) {
    	delete(m /* ERROR "not a map" */, "foo")
    }
    
    func _[T M0](m T) {
    	delete(m /* ERROR "not a map" */, "foo")
    }
    
    func _[T M1](m T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 18 21:16:29 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  5. test/typeparam/mapsimp.dir/main.go

    	}
    	a.Add(mc, map[int]int{16: 32})
    	want := map[int]int{1: 2, 2: 4, 4: 8, 8: 16, 16: 32}
    	if !a.Equal(mc, want) {
    		panic(fmt.Sprintf("a.Add result = %v, want %v", mc, want))
    	}
    }
    
    func TestSub() {
    	mc := a.Copy(m1)
    	a.Sub(mc, mc)
    	if len(mc) > 0 {
    		panic(fmt.Sprintf("a.Sub(%v, %v) = %v, want empty map", m1, m1, mc))
    	}
    	mc = a.Copy(m1)
    	a.Sub(mc, map[int]int{1: 0})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top