Search Options

Results per page
Sort
Preferred Languages
Advance

Results 131 - 140 of 254 for elem1 (0.32 sec)

  1. src/path/path.go

    // empty or all its elements are empty, Join returns
    // an empty string.
    func Join(elem ...string) string {
    	size := 0
    	for _, e := range elem {
    		size += len(e)
    	}
    	if size == 0 {
    		return ""
    	}
    	buf := make([]byte, 0, size+len(elem)-1)
    	for _, e := range elem {
    		if len(buf) > 0 || e != "" {
    			if len(buf) > 0 {
    				buf = append(buf, '/')
    			}
    			buf = append(buf, e...)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 23 17:33:57 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  2. pkg/printers/tablegenerator.go

    			"Must accept 2 parameters and return 2 value")
    	}
    	if funcType.In(1) != reflect.TypeOf((*GenerateOptions)(nil)).Elem() ||
    		funcType.Out(0) != reflect.TypeOf((*[]metav1.TableRow)(nil)).Elem() ||
    		funcType.Out(1) != reflect.TypeOf((*error)(nil)).Elem() {
    		return fmt.Errorf("invalid print handler. The expected signature is: "+
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 26 17:14:05 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  3. test/fixedbugs/bug510.dir/a.go

    // license that can be found in the LICENSE file.
    
    package a
    
    import "reflect"
    
    type A = map[int] bool
    
    func F() interface{} {
    	return reflect.New(reflect.TypeOf((*A)(nil))).Elem().Interface()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 07 17:29:52 UTC 2020
    - 304 bytes
    - Viewed (0)
  4. test/fixedbugs/issue47068.dir/b.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package b
    
    import "reflect"
    
    func B() {
    	t1 := reflect.TypeOf([30]int{})
    	t2 := reflect.TypeOf(new([30]int)).Elem()
    	if t1 != t2 {
    		panic("[30]int types do not match")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 23 19:49:23 UTC 2021
    - 334 bytes
    - Viewed (0)
  5. src/cmd/compile/internal/ssa/_gen/dec.rules

    (SlicePtr (SliceMake ptr _ _ )) => ptr
    (SliceLen (SliceMake _ len _)) => len
    (SliceCap (SliceMake _ _ cap)) => cap
    (SlicePtrUnchecked (SliceMake ptr _ _ )) => ptr
    
    (Load <t> ptr mem) && t.IsSlice() =>
      (SliceMake
        (Load <t.Elem().PtrTo()> ptr mem)
        (Load <typ.Int>
          (OffPtr <typ.IntPtr> [config.PtrSize] ptr)
          mem)
        (Load <typ.Int>
          (OffPtr <typ.IntPtr> [2*config.PtrSize] ptr)
          mem))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 12 00:48:31 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  6. src/cmd/link/internal/ld/testdata/deadcode/ifacemethod3.go

    func (s S) M() { println("S.M") }
    
    type I interface{ M() }
    
    type T float64
    
    func (t T) F(s S) {}
    
    func main() {
    	var t T
    	ft := reflect.TypeOf(t).Method(0).Type
    	at := ft.In(1)
    	v := reflect.New(at).Elem()
    	v.Interface().(I).M()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 15 21:49:19 UTC 2021
    - 615 bytes
    - Viewed (0)
  7. test/fixedbugs/issue22605.go

    package main
    
    import "reflect"
    
    func f(m map[string]int) int {
    	return m["a"]
    }
    
    func g(m map[[8]string]int) int {
    	t := reflect.ArrayOf(8, reflect.TypeOf(""))
    	a := reflect.New(t).Elem()
    	return m[a.Interface().([8]string)]
    }
    
    func main() {
    	m := map[[8]string]int{}
    	g(m)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 07 22:29:48 UTC 2017
    - 504 bytes
    - Viewed (0)
  8. test/clear.go

    // license that can be found in the LICENSE file.
    
    package main
    
    import "math"
    
    func checkClearSlice() {
    	s := []int{1, 2, 3}
    	clear(s)
    	for i := range s {
    		if s[i] != 0 {
    			panic("clear not zeroing slice elem")
    		}
    	}
    
    	clear([]int{})
    }
    
    func checkClearMap() {
    	m1 := make(map[int]int)
    	m1[0] = 0
    	m1[1] = 1
    	clear(m1)
    	if len(m1) != 0 {
    		panic("m1 is not cleared")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 31 19:43:07 UTC 2023
    - 743 bytes
    - Viewed (0)
  9. test/fixedbugs/issue65957.dir/main.go

    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)
  10. test/typeparam/issue48253.go

    package main
    
    import (
    	"reflect"
    )
    
    type A[T any] struct {
    	B[int]
    }
    
    type B[T any] struct {
    }
    
    func (b B[T]) Bat() {
    	t := new(T)
    	if tt := reflect.TypeOf(t); tt.Kind() != reflect.Pointer || tt.Elem().Kind() != reflect.Int {
    		panic("unexpected type, want: *int, got: "+tt.String())
    	}
    }
    
    type Foo struct {
    	A[string]
    }
    func main() {
    	Foo{}.A.Bat()
    	Foo{}.A.B.Bat()
    	Foo{}.Bat()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 551 bytes
    - Viewed (0)
Back to top