Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 507 for Map (0.02 sec)

  1. src/go/parser/resolver_test.go

    // '=@bar'. It returns a map of name->position for declarations, and
    // name->position(s) for uses.
    func positionMarkers(handle *token.File, src []byte) (decls map[string]token.Pos, uses map[string][]token.Pos) {
    	var s scanner.Scanner
    	s.Init(handle, src, nil, scanner.ScanComments)
    	decls = make(map[string]token.Pos)
    	uses = make(map[string][]token.Pos)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 19 17:46:07 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  2. test/live2.go

    package main
    
    // issue 8142: lost 'addrtaken' bit on inlined variables.
    
    func printnl()
    
    //go:noescape
    func useT40(*T40)
    
    type T40 struct {
    	m map[int]int
    }
    
    func newT40() *T40 {
    	ret := T40{}
    	ret.m = make(map[int]int, 42) // ERROR "live at call to makemap: &ret$"
    	return &ret
    }
    
    func bad40() {
    	t := newT40() // ERROR "stack object ret T40$" "stack object .autotmp_[0-9]+ runtime.hmap$"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 21 23:29:33 UTC 2023
    - 953 bytes
    - Viewed (0)
  3. test/typeparam/issue53087.go

    	str string
    }
    
    func (s *S) M() {}
    
    var _ I = &S{}
    
    type CloningMap[K comparable, V any] struct {
    	inner map[K]V
    }
    
    func (cm CloningMap[K, V]) With(key K, value V) CloningMap[K, V] {
    	result := CloneBad(cm.inner)
    	result[key] = value
    	return CloningMap[K, V]{result}
    }
    
    func CloneBad[M ~map[K]V, K comparable, V any](m M) M {
    	r := make(M, len(m))
    	for k, v := range m {
    		r[k] = v
    	}
    	return r
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 08 16:23:09 UTC 2023
    - 930 bytes
    - Viewed (0)
  4. src/go/types/methodset.go

    	// We must use a lookup on identity rather than a simple map[*Named]bool as
    	// instantiated types may be identical but not equal.
    	var seen instanceLookup
    
    	// collect methods at current depth
    	for len(current) > 0 {
    		var next []embeddedType // embedded types found at current depth
    
    		// field and method sets at current depth, indexed by names (Id's), and allocated lazily
    		var fset map[string]bool // we only care about the field names
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  5. src/internal/trace/reader.go

    			go121Events: convertOldFormat(tr),
    		}, nil
    	case version.Go122, version.Go123:
    		return &Reader{
    			r: br,
    			order: ordering{
    				mStates:     make(map[ThreadID]*mState),
    				pStates:     make(map[ProcID]*pState),
    				gStates:     make(map[GoID]*gState),
    				activeTasks: make(map[TaskID]taskState),
    			},
    			// Don't emit a sync event when we first go to emit events.
    			emittedSync: true,
    		}, nil
    	default:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  6. src/maps/example_test.go

    	fmt.Println("m3 is:", m3)
    	fmt.Println("m4 is:", m4)
    
    	// Output:
    	// m2 is: map[one:1 two:2]
    	// m1 is: map[one:1 two:2]
    	// m2 is: map[one:100 two:2]
    	// m4 is: map[one:[1 2 3] two:[4 5 6]]
    	// m3 is: map[one:[100 2 3] two:[4 5 6]]
    	// m4 is: map[one:[100 2 3] two:[4 5 6]]
    }
    
    func ExampleDeleteFunc() {
    	m := map[string]int{
    		"one":   1,
    		"two":   2,
    		"three": 3,
    		"four":  4,
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 11 20:21:56 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  7. src/cmd/fix/main.go

    		os.Exit(exitCode)
    	}
    
    	sort.Sort(byDate(fixes))
    
    	if *allowedRewrites != "" {
    		allowed = make(map[string]bool)
    		for _, f := range strings.Split(*allowedRewrites, ",") {
    			allowed[f] = true
    		}
    	}
    
    	if *forceRewrites != "" {
    		force = make(map[string]bool)
    		for _, f := range strings.Split(*forceRewrites, ",") {
    			force[f] = true
    		}
    	}
    
    	if flag.NArg() == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  8. src/net/rpc/jsonrpc/server.go

    	// We assign uint64 sequence numbers to incoming requests
    	// but save the original request ID in the pending map.
    	// When rpc responds, we use the sequence number in
    	// the response to find the original request ID.
    	mutex   sync.Mutex // protects seq, pending
    	seq     uint64
    	pending map[uint64]*json.RawMessage
    }
    
    // NewServerCodec returns a new [rpc.ServerCodec] using JSON-RPC on conn.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  9. src/cmd/trace/threadgen.go

    	logEventGenerator[trace.ThreadID]
    
    	gStates map[trace.GoID]*gState[trace.ThreadID]
    	threads map[trace.ThreadID]struct{}
    }
    
    func newThreadGenerator() *threadGenerator {
    	tg := new(threadGenerator)
    	rg := func(ev *trace.Event) trace.ThreadID {
    		return ev.Thread()
    	}
    	tg.stackSampleGenerator.getResource = rg
    	tg.logEventGenerator.getResource = rg
    	tg.gStates = make(map[trace.GoID]*gState[trace.ThreadID])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  10. test/linknameasm.dir/x.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // Test that a linkname applied on an assembly declaration
    // does not affect stack map generation.
    
    package main
    
    import (
    	"runtime"
    	_ "unsafe"
    )
    
    //go:linkname asm
    func asm(*int)
    
    func main() {
    	x := new(int)
    	asm(x)
    }
    
    // called from asm
    func callback() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 15:22:22 UTC 2024
    - 451 bytes
    - Viewed (0)
Back to top