package
module
Version:
v0.0.1
Opens a new window with list of versions in this module.
Published: Oct 10, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
GOSON
Useage
- you can use it like json.Marshal
goson.Marshal()
goson.Unmarshal
- you can use set/get value on marshal/unmarshal
type Example struct {
version string `json:"version"`
}
func (t *Example) SetVersion(version string) {
t.version = version
}
func (t Example) Version() string {
return t.version
}
- and you can define the custom function to set/get value on marshal/unmarshal
type Example struct {
version string `json:"version" json-getter:"Version" json-setter:"SetMyVersion"`
}
func (t *Example) SetMyVersion(version string) {
t.version = version
}
func (t Example) Version() string {
return t.version
}
Documentation
¶
func MarshalJSON(v interface{}) ([]byte, error)
func UnmarshalJSON(data []byte, v interface{}) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.