Structs: fix documentation
This commit is contained in:
parent
852670f7c6
commit
995f03a605
9
field.go
9
field.go
@ -85,13 +85,14 @@ func (f *Field) Set(val interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Fields returns a slice of Fields. A struct tag with the content of "-"
|
||||
// ignores the checking of that particular field. Example:
|
||||
// Fields returns a slice of Fields. This is particular handy to get the fields
|
||||
// of a nested struct . A struct tag with the content of "-" ignores the
|
||||
// checking of that particular field. Example:
|
||||
//
|
||||
// // Field is ignored by this package.
|
||||
// Field bool `structs:"-"`
|
||||
// Field *http.Request `structs:"-"`
|
||||
//
|
||||
// It panics if s's kind is not struct.
|
||||
// It panics if field is not exported or if field's kind is not struct
|
||||
func (f *Field) Fields() []*Field {
|
||||
return getFields(f.value)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user