Update README.md
This commit is contained in:
parent
8a1e78be51
commit
5195e6e0a9
@ -45,16 +45,16 @@ v := structs.Values(server)
|
|||||||
|
|
||||||
// Convert the values of a struct to a []*Field
|
// Convert the values of a struct to a []*Field
|
||||||
// (see "Field methods" for more info about fields)
|
// (see "Field methods" for more info about fields)
|
||||||
f := structs.Fields(server) // Get a []*Field
|
f := structs.Fields(server)
|
||||||
|
|
||||||
// Return the struct name => "Server"
|
// Return the struct name => "Server"
|
||||||
n := structs.Name(server) // Get the struct name
|
n := structs.Name(server)
|
||||||
|
|
||||||
// Check if any field of a struct is initialized or not.
|
// Check if any field of a struct is initialized or not.
|
||||||
h := structs.HasZero(server) // Check if any field is initialized
|
h := structs.HasZero(server)
|
||||||
|
|
||||||
// Check if all fields of a struct is initialized or not.
|
// Check if all fields of a struct is initialized or not.
|
||||||
z := structs.IsZero(server) // Check if all fields are initialized
|
z := structs.IsZero(server)
|
||||||
|
|
||||||
// Check if server is a struct or a pointer to struct
|
// Check if server is a struct or a pointer to struct
|
||||||
i := structs.IsStruct(server)
|
i := structs.IsStruct(server)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user