Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 30 for setstruct (0.19 sec)

  1. pkg/typemap/map_test.go

    	typemap.Set[TestInterface[string]](tm, TestStruct{Field: "interface"})
    
    	assert.Equal(t, typemap.Get[int](tm), ptr.Of(1))
    	assert.Equal(t, typemap.Get[int32](tm), ptr.Of(int32(2)))
    	assert.Equal(t, typemap.Get[string](tm), ptr.Of("string"))
    	assert.Equal(t, typemap.Get[*TestStruct](tm), ptr.Of(&TestStruct{Field: "pointer"}))
    	assert.Equal(t, typemap.Get[TestInterface[string]](tm), ptr.Of(TestInterface[string](TestStruct{Field: "interface"})))
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 17 16:38:40 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  2. test/fixedbugs/bug054.go

    func (v *Vector) At(i int) Element {
    	return v.elem[i];
    }
    
    type TStruct struct {
    	name string;
    	fields *Vector;
    }
    
    func (s *TStruct) field(i int) *TStruct {
    	return s.fields.At(i).(*TStruct);
    }
    
    func main() {
    	v := new(Vector);
    	v.elem = make([]Element, 10);
    	t := new(TStruct);
    	t.name = "hi";
    	v.elem[0] = t;
    	s := new(TStruct);
    	s.name = "foo";
    	s.fields = v;
    	if s.field(0).name != "hi" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 04:48:57 UTC 2012
    - 669 bytes
    - Viewed (0)
  3. staging/src/k8s.io/cli-runtime/pkg/printers/json_test.go

    	"k8s.io/apimachinery/pkg/util/json"
    	"k8s.io/client-go/kubernetes/scheme"
    )
    
    var testData = TestStruct{
    	TypeMeta:   metav1.TypeMeta{APIVersion: "foo/bar", Kind: "TestStruct"},
    	Key:        "testValue",
    	Map:        map[string]int{"TestSubkey": 1},
    	StringList: []string{"a", "b", "c"},
    	IntList:    []int{1, 2, 3},
    }
    
    type TestStruct struct {
    	metav1.TypeMeta   `json:",inline"`
    	metav1.ObjectMeta `json:"metadata,omitempty"`
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:12 UTC 2023
    - 4K bytes
    - Viewed (0)
  4. pkg/config/model_test.go

    				return c
    			},
    			protocmp.Transform(),
    		},
    		// Random struct pointer
    		{
    			&TestStruct{Name: "foobar"},
    			func(c Spec) Spec {
    				c.(*TestStruct).Name = "bar"
    				return c
    			},
    			nil,
    		},
    		// Random struct
    		{
    			TestStruct{Name: "foobar"},
    			func(c Spec) Spec {
    				x := c.(TestStruct)
    				x.Name = "bar"
    				return x
    			},
    			nil,
    		},
    		// Slice
    		{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 12 17:37:32 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  5. src/unique/handle_test.go

    	testHandle[testStringStruct](t, testStringStruct{"x"})
    	testHandle[testStringStructArrayStruct](t, testStringStructArrayStruct{
    		s: [2]testStringStruct{testStringStruct{"y"}, testStringStruct{"z"}},
    	})
    	testHandle[testStruct](t, testStruct{0.5, "184"})
    }
    
    func testHandle[T comparable](t *testing.T, value T) {
    	name := reflect.TypeFor[T]().Name()
    	t.Run(fmt.Sprintf("%s/%#v", name, value), func(t *testing.T) {
    		t.Parallel()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 18:14:07 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/noder/lex_test.go

    		if !eq(got, tt.want) {
    			t.Errorf("pragmaFields(%q) = %v; want %v", tt.in, got, tt.want)
    			continue
    		}
    	}
    }
    
    func TestPragcgo(t *testing.T) {
    	type testStruct struct {
    		in   string
    		want []string
    	}
    
    	var tests = []testStruct{
    		{`go:cgo_export_dynamic local`, []string{`cgo_export_dynamic`, `local`}},
    		{`go:cgo_export_dynamic local remote`, []string{`cgo_export_dynamic`, `local`, `remote`}},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 23 06:39:06 UTC 2020
    - 3.6K bytes
    - Viewed (0)
  7. test/typeparam/issue47716.go

    	return unsafe.Sizeof(x)
    }
    
    // size returns the alignment of type T
    func align[T any](x T) uintptr {
    	return unsafe.Alignof(x)
    }
    
    type Tstruct[T any] struct {
    	f1 T
    	f2 int
    }
    
    // offset returns the offset of field f2 in the generic type Tstruct
    func (r *Tstruct[T]) offset() uintptr {
    	return unsafe.Offsetof(r.f2)
    }
    
    func main() {
    	v1 := int(5)
    	if got, want := size(v1), unsafe.Sizeof(v1); got != want {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  8. src/testing/quick/quick_test.go

    func fString(a string) string { return a }
    
    type TestStringAlias string
    
    func fStringAlias(a TestStringAlias) TestStringAlias { return a }
    
    type TestStruct struct {
    	A int
    	B string
    }
    
    func fStruct(a TestStruct) TestStruct { return a }
    
    type TestStructAlias TestStruct
    
    func fStructAlias(a TestStructAlias) TestStructAlias { return a }
    
    func fUint16(a uint16) uint16 { return a }
    
    type TestUint16Alias uint16
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 12:54:00 UTC 2019
    - 9K bytes
    - Viewed (0)
  9. analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/KtFirDestructuringDeclarationSymbol.kt

        override val analysisSession: KaFirSession,
    ) : KaDestructuringDeclarationSymbol(), KaFirSymbol<FirVariableSymbol<*>> {
    
        init {
            require(firSymbol.name == SpecialNames.DESTRUCT)
        }
    
        override val psi: KtDestructuringDeclaration
            get() = withValidityAssertion {
                when (val psi = firSymbol.fir.psi) {
                    is KtDestructuringDeclaration -> psi
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Tue Jun 11 15:45:42 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  10. tensorflow/c/eager/tfe_op_internal.h

    #include "tensorflow/c/eager/immediate_execution_operation.h"
    
    // Wraps a pointer to an operation implementation.
    //
    // WARNING: Since the underlying object could be ref-counted a user of this
    // interface cannot destruct the underlying operation object. Instead, call
    // TFE_DeleteOp who calls Release() on the operation pointer and deletes
    // the TFE_Op structure.
    typedef struct TFE_Op TFE_Op;
    
    namespace tensorflow {
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jun 17 19:39:13 UTC 2020
    - 1.4K bytes
    - Viewed (0)
Back to top