Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 329 for Map (0.03 sec)

  1. test/fixedbugs/issue65957.dir/main.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    import (
    	"./a"
    	"reflect"
    )
    
    var s = []rune{0, 1, 2, 3}
    
    func main() {
    	m := map[any]int{}
    	k := reflect.New(reflect.ArrayOf(4, reflect.TypeOf(int32(0)))).Elem().Interface()
    	m[k] = 1
    	a.F()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 28 05:32:14 UTC 2024
    - 368 bytes
    - Viewed (0)
  2. src/cmd/trace/goroutinegen.go

    	globalRangeGenerator
    	globalMetricGenerator
    	stackSampleGenerator[trace.GoID]
    	logEventGenerator[trace.GoID]
    
    	gStates map[trace.GoID]*gState[trace.GoID]
    	focus   trace.GoID
    	filter  map[trace.GoID]struct{}
    }
    
    func newGoroutineGenerator(ctx *traceContext, focus trace.GoID, filter map[trace.GoID]struct{}) *goroutineGenerator {
    	gg := new(goroutineGenerator)
    	rg := func(ev *trace.Event) trace.GoID {
    		return ev.Goroutine()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  3. src/reflect/iter.go

    // If v's kind is Pointer, the pointer element type must have kind Array.
    // Otherwise v's kind must be Int, Int8, Int16, Int32, Int64,
    // Uint, Uint8, Uint16, Uint32, Uint64, Uintptr,
    // Array, Chan, Map, Slice, or String.
    func (v Value) Seq() iter.Seq[Value] {
    	if canRangeFunc(v.typ()) {
    		return func(yield func(Value) bool) {
    			rf := MakeFunc(v.Type().In(0), func(in []Value) []Value {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 13:40:11 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  4. src/maps/iter_test.go

    			if !yield(i, i+1) {
    				return
    			}
    		}
    	})
    
    	want := map[int]int{
    		1: 1,
    		2: 1,
    	}
    	for i, v := range map[int]int{
    		0: 1,
    		2: 3,
    		4: 5,
    		6: 7,
    		8: 9,
    	} {
    		want[i] = v
    	}
    
    	if !Equal(got, want) {
    		t.Errorf("Insert got: %v, want: %v", got, want)
    	}
    }
    
    func TestCollect(t *testing.T) {
    	m := map[int]int{
    		0: 1,
    		2: 3,
    		4: 5,
    		6: 7,
    		8: 9,
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:44:19 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  5. src/cmd/trace/jsontrace_test.go

    // "blocked" argument is equal to blocked.
    func filterBlocked(blocked string) eventFilterFn {
    	return func(e *format.Event, _ *format.Data) bool {
    		m, ok := e.Arg.(map[string]any)
    		if !ok {
    			return false
    		}
    		return m["blocked"] == blocked
    	}
    }
    
    // filterStackRootFunc returns an event filter that returns true if the function
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  6. src/go/parser/interface.go

    // must not be nil.
    //
    // If the directory couldn't be read, a nil map and the respective error are
    // returned. If a parse error occurred, a non-nil but incomplete map and the
    // first error encountered are returned.
    func ParseDir(fset *token.FileSet, path string, filter func(fs.FileInfo) bool, mode Mode) (pkgs map[string]*ast.Package, first error) {
    	list, err := os.ReadDir(path)
    	if err != nil {
    		return nil, err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  7. test/maplinear.go

    func main() {
    	// NaNs. ~31ms on a 1.6GHz Zeon.
    	checkLinear("NaN", 30000, func(n int) {
    		m := map[float64]int{}
    		nan := math.NaN()
    		for i := 0; i < n; i++ {
    			m[nan] = 1
    		}
    		if len(m) != n {
    			panic("wrong size map after nan insertion")
    		}
    	})
    
    	// ~6ms on a 1.6GHz Zeon.
    	checkLinear("eface", 10000, func(n int) {
    		m := map[interface{}]int{}
    		for i := 0; i < n; i++ {
    			m[i] = 1
    		}
    	})
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  8. src/internal/types/testdata/fixedbugs/issue66878.go

    package p
    
    func _[T bool](ch chan T) {
    	var _, _ T = <-ch
    }
    
    // offending code snippets from issue
    
    func _[T ~bool](ch <-chan T) {
    	var x, ok T = <-ch
    	println(x, ok)
    }
    
    func _[T ~bool](m map[int]T) {
    	var x, ok T = m[0]
    	println(x, ok)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 17:42:47 UTC 2024
    - 399 bytes
    - Viewed (0)
  9. src/go/types/context.go

    // The use of a shared context does not guarantee that identical instances are
    // deduplicated in all cases.
    type Context struct {
    	mu        sync.Mutex
    	typeMap   map[string][]ctxtEntry // type hash -> instances entries
    	nextID    int                    // next unique ID
    	originIDs map[Type]int           // origin type -> unique ID
    }
    
    type ctxtEntry struct {
    	orig     Type
    	targs    []Type
    	instance Type // = orig[targs]
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/syntax/testdata/issue23434.go

    package p
    
    type T /* ERROR unexpected newline */
    
    type Map map[int] /* ERROR unexpected newline */
    
    // Examples from go.dev/issue/23434:
    
    func g() {
    	m := make(map[string] /* ERROR unexpected ! */ !)
    	for {
    		x := 1
    		print(x)
    	}
    }
    
    func f() {
    	m := make(map[string] /* ERROR unexpected \) */ )
    	for {
    		x := 1
    		print(x)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 01 12:49:49 UTC 2023
    - 653 bytes
    - Viewed (0)
Back to top