readme: add example about field fields
This commit is contained in:
parent
db46c5303b
commit
ebbcf66cbe
@ -127,6 +127,9 @@ addrField := s.Field("Server").Field("Addr")
|
|||||||
|
|
||||||
// Get the value for addr
|
// Get the value for addr
|
||||||
a := addrField.Value().(string)
|
a := addrField.Value().(string)
|
||||||
|
|
||||||
|
// Or get all fields
|
||||||
|
httpServer := s.Field("Server").Fields()
|
||||||
```
|
```
|
||||||
|
|
||||||
We can also get a slice of Fields from the Struct type to iterate over all
|
We can also get a slice of Fields from the Struct type to iterate over all
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user