- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for FieldByIndexErr (0.28 sec)
-
src/reflect/visiblefields_test.go
} } // Must not panic with nil embedded pointer. func TestFieldByIndexErr(t *testing.T) { type A struct { S string } type B struct { *A } v := ValueOf(B{}) _, err := v.FieldByIndexErr([]int{0, 0}) if err == nil { t.Fatal("expected error") } if !strings.Contains(err.Error(), "embedded struct field A") { t.Fatal(err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 08 13:44:41 UTC 2022 - 5.3K bytes - Viewed (0) -
api/go1.18.txt
pkg reflect, method (Value) CanComplex() bool pkg reflect, method (Value) CanFloat() bool pkg reflect, method (Value) CanInt() bool pkg reflect, method (Value) CanUint() bool pkg reflect, method (Value) FieldByIndexErr([]int) (Value, error) pkg reflect, method (Value) SetIterKey(*MapIter) pkg reflect, method (Value) SetIterValue(*MapIter) pkg reflect, method (Value) UnsafePointer() unsafe.Pointer
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Feb 17 20:31:46 UTC 2023 - 13K bytes - Viewed (0) -
src/text/template/exec.go
// It's not a method; must be a field of a struct or an element of a map. switch receiver.Kind() { case reflect.Struct: tField, ok := receiver.Type().FieldByName(fieldName) if ok { field, err := receiver.FieldByIndexErr(tField.Index) if !tField.IsExported() { s.errorf("%s is an unexported field of struct type %s", fieldName, typ) } if err != nil { s.errorf("%v", err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 24 21:22:24 UTC 2024 - 32K bytes - Viewed (0) -
src/reflect/value.go
v = v.Elem() } } v = v.Field(x) } return v } // FieldByIndexErr returns the nested field corresponding to index. // It returns an error if evaluation requires stepping through a nil // pointer, but panics if it must step through a field that // is not a struct. func (v Value) FieldByIndexErr(index []int) (Value, error) { if len(index) == 1 { return v.Field(index[0]), nil }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 21:17:41 UTC 2024 - 119.9K bytes - Viewed (0) -
src/text/template/exec_test.go
if err != nil { t.Error(err) } } }() } wg.Wait() } // Issue 48215: embedded nil pointer causes panic. // Fixed by adding FieldByIndexErr to the reflect package. func TestIssue48215(t *testing.T) { type A struct { S string } type B struct { *A } tmpl, err := New("").Parse(`{{ .S }}`) if err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 24 22:23:55 UTC 2024 - 60.1K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"(Value).Convert", Method, 1}, {"(Value).Elem", Method, 0}, {"(Value).Equal", Method, 20}, {"(Value).Field", Method, 0}, {"(Value).FieldByIndex", Method, 0}, {"(Value).FieldByIndexErr", Method, 18}, {"(Value).FieldByName", Method, 0}, {"(Value).FieldByNameFunc", Method, 0}, {"(Value).Float", Method, 0}, {"(Value).Grow", Method, 20}, {"(Value).Index", Method, 0},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 534.2K bytes - Viewed (0)