Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NestedMockItem ¶
type NestedMockItem struct {
NestedItem MockItem
}
func (NestedMockItem) ToStruct ¶
func (mockItem NestedMockItem) ToStruct(jsonString string) (interface{}, error)
ToStruct converts json string to struct
type Serializable ¶
Serializable converts a json string into the struct
Example: For the struct
type Person struct { Name string }
The ToStruct function looks like:
func (person *Person) ToStruct(jsonString string) (interface{}, error) { err := json.Unmarshal([]byte(jsonString), &person) return person, err }
Click to show internal directories.
Click to hide internal directories.