Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 547 for Map (0.11 sec)

  1. src/go/types/map.go

    // Source: ../../cmd/compile/internal/types2/map.go
    
    // Copyright 2011 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 types
    
    // A Map represents a map type.
    type Map struct {
    	key, elem Type
    }
    
    // NewMap returns a new map for the given key and element types.
    func NewMap(key, elem Type) *Map {
    	return &Map{key: key, elem: elem}
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 781 bytes
    - Viewed (0)
  2. src/internal/abi/map.go

    // Copyright 2023 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 abi
    
    // Map constants common to several packages
    // runtime/runtime-gdb.py:MapTypePrinter contains its own copy
    const (
    	// Maximum number of key/elem pairs a bucket can hold.
    	MapBucketCountBits = 3 // log2 of number of elements in a bucket.
    	MapBucketCount     = 1 << MapBucketCountBits
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 20:09:01 UTC 2024
    - 719 bytes
    - Viewed (0)
  3. test/codegen/maps.go

    package codegen
    
    // This file contains code generation tests related to the handling of
    // map types.
    
    // ------------------- //
    //     Access Const    //
    // ------------------- //
    
    // Direct use of constants in fast map access calls (Issue #19015).
    
    func AccessInt1(m map[int]int) int {
    	// amd64:"MOV[LQ]\t[$]5"
    	return m[5]
    }
    
    func AccessInt2(m map[int]int) bool {
    	// amd64:"MOV[LQ]\t[$]5"
    	_, ok := m[5]
    	return ok
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 23 15:51:32 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/telemetry/internal/config/config.go

    type Config struct {
    	*telemetry.UploadConfig
    	program         map[string]bool
    	goos            map[string]bool
    	goarch          map[string]bool
    	goversion       map[string]bool
    	pgversion       map[pgkey]bool
    	pgcounter       map[pgkey]bool
    	pgcounterprefix map[pgkey]bool
    	pgstack         map[pgkey]bool
    	rate            map[pgkey]float64
    }
    
    type pgkey struct {
    	program, key string
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:57:25 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  5. test/typeparam/builtins.go

    }
    
    func f4[T C5[X], X any](ch T) {
    	close(ch)
    }
    
    // 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 g1[T M1](m T) {
    	delete(m, "foo")
    }
    
    func g2[T M2](m T) {
    	delete(m, "foo")
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 09:04:48 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  6. src/expvar/expvar.go

    	v.f.Store(math.Float64bits(value))
    }
    
    // Map is a string-to-Var map variable that satisfies the [Var] interface.
    type Map struct {
    	m      sync.Map // map[string]Var
    	keysMu sync.RWMutex
    	keys   []string // sorted
    }
    
    // KeyValue represents a single entry in a [Map].
    type KeyValue struct {
    	Key   string
    	Value Var
    }
    
    func (v *Map) String() string {
    	return string(v.appendJSON(nil))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 21:32:11 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  7. src/internal/types/testdata/check/map0.go

    	key         K
    	val         V
    	left, right *node[K, V]
    }
    
    // New returns a new map.
    func New[K, V any](compare func(K, K) int) *Map[K, V] {
            return &Map[K, V]{compare: compare}
    }
    
    // find looks up key in the map, and returns either a pointer
    // to the node holding key, or a pointer to the location where
    // such a node would go.
    func (m *Map[K, V]) find(key K) **node[K, V] {
    	pn := &m.root
    	for *pn != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:25 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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)
Back to top