Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 218 for S1 (0.15 sec)

  1. test/typeparam/interfacearg.go

    func F() {
    	v := _S[I]{}
    	if v.x != nil {
    		panic(v)
    	}
    }
    
    // Testing the various combinations of method expressions.
    type S1 struct{}
    
    func (*S1) M() {}
    
    type S2 struct{}
    
    func (S2) M() {}
    
    func _F1[T interface{ M() }](t T) {
    	_ = T.M
    }
    
    func F2() {
    	_F1(&S1{})
    	_F1(S2{})
    	_F1(&S2{})
    }
    
    func main() {
    	F()
    	F2()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 692 bytes
    - Viewed (0)
  2. test/fixedbugs/issue8606.go

    		{true, T3{i: b, s: "foo"}, T3{i: b, s: "bar"}},
    		{false, T3{s: "foo", j: b}, T3{s: "bar", j: b}},
    		{true, T3{i: b, s: "fooz"}, T3{i: b, s: "bar"}},
    		{false, T3{s: "fooz", j: b}, T3{s: "bar", j: b}},
    		{true, A{s1, s2}, A{s2, s1}},
    		{true, s1, s2},
    		{false, S4{[1000]byte{0}, func() {}}, S4{[1000]byte{1}, func() {}}},
    	} {
    		f := func() {
    			defer func() {
    				if recover() != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 21:55:14 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  3. src/io/fs/readfile_test.go

    }
    
    func TestReadFilePath(t *testing.T) {
    	fsys := os.DirFS(t.TempDir())
    	_, err1 := ReadFile(fsys, "non-existent")
    	_, err2 := ReadFile(struct{ FS }{fsys}, "non-existent")
    	if s1, s2 := errorPath(err1), errorPath(err2); s1 != s2 {
    		t.Fatalf("s1: %s != s2: %s", s1, s2)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 27 16:25:41 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  4. src/internal/types/testdata/check/linalg.go

    		~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr |
    		~float32 | ~float64 |
    		~complex64 | ~complex128
    }
    
    func DotProduct[T Numeric](s1, s2 []T) T {
    	if len(s1) != len(s2) {
    		panic("DotProduct: slices of unequal length")
    	}
    	var r T
    	for i := range s1 {
    		r += s1[i] * s2[i]
    	}
    	return r
    }
    
    // NumericAbs matches numeric types with an Abs method.
    type NumericAbs[T any] interface {
    	Numeric
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 02 02:58:32 UTC 2022
    - 2.2K bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/testsanitizers/testdata/asan_linkerx/main.go

    func pstring(s *string) {
    	println(*s)
    }
    
    func main() {
    	all := []*string{
    		&S1, &S2, &S3, &S4, &S5, &S6, &S7, &S8, &S9, &S10,
    		&p.S1, &p.S2, &p.S3, &p.S4, &p.S5, &p.S6, &p.S7, &p.S8, &p.S9, &p.S10,
    	}
    	for _, ps := range all {
    		pstring(ps)
    	}
    }
    
    var S1 string
    var S2 string
    var S3 string
    var S4 string
    var S5 string
    var S6 string
    var S7 string
    var S8 string
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 471 bytes
    - Viewed (0)
  6. test/fixedbugs/issue8620.go

    // Issue 8620. Used to fail with -race.
    
    package main
    
    func min(a, b int) int {
    	if a < b {
    		return a
    	}
    	return b
    }
    
    func test(s1, s2 []struct{}) {
    	n := min(len(s1), len(s2))
    	if copy(s1, s2) != n {
    		panic("bad copy result")
    	}
    }
    
    func main() {
    	var b [100]struct{}
    	test(b[:], b[:])
    	test(b[1:], b[:])
    	test(b[:], b[2:])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 496 bytes
    - Viewed (0)
  7. test/fixedbugs/bug021.go

    // run
    
    // Copyright 2009 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 main
    
    func main() {
    	s1 := "hi";
    	s2 := "ho";
    	s1 += s2;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 04:48:57 UTC 2012
    - 235 bytes
    - Viewed (0)
  8. test/fixedbugs/bug437.dir/one.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package one
    
    type I1 interface {
    	f()
    }
    
    type S1 struct {
    }
    
    func (s S1) f() {
    }
    
    func F1(i1 I1) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 261 bytes
    - Viewed (0)
  9. src/internal/coverage/slicereader/slr_test.go

    	e64 := uint64(907050301)
    	binary.LittleEndian.PutUint64(bt, e64)
    	b = append(b, bt...)
    
    	b = appendUleb128(b, uint(e32))
    	b = appendUleb128(b, uint(e64))
    	b = appendUleb128(b, 6)
    	s1 := "foobar"
    	s1b := []byte(s1)
    	b = append(b, s1b...)
    	b = appendUleb128(b, 9)
    	s2 := "bazbasher"
    	s2b := []byte(s2)
    	b = append(b, s2b...)
    
    	readStr := func(slr *Reader) string {
    		len := slr.ReadULEB128()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 11:36:28 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  10. test/literal.go

    	var cu1 uint32 = '\U00101234'
    	assert(cu0 == 0x1234, "cu0")
    	assert(cu1 == 0x101234, "cu1")
    
    	// string
    	var s0 string = ""
    	var s1 string = "hellĂ´"
    	assert(s1[0] == 'h', "s1-0")
    	assert(s1[4] == 0xc3, "s1-4")
    	assert(s1[5] == 0xb4, "s1-5")
    	var s2 string = "\a\b\f\n\r\t\v"
    	_, _ = s0, s2
    
    	var s00 string = "\000"
    	var s01 string = "\007"
    	var s02 string = "\377"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 12 18:17:49 UTC 2013
    - 5K bytes
    - Viewed (0)
Back to top