package
module
Version:
v0.0.0-...-ea3c94a
Opens a new window with list of versions in this module.
Published: Jan 30, 2023
License: MIT
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.
Documentation
¶
MarshalAll takes some data stored in structs
and converts them to the various data formats
func OtherJSONExamples() error
OtherJSONExamples shows ways to use types
beyond structs and other useful functions
func UnmarshalAll() error
UnmarshalAll takes data in various formats
and converts them into structs
type JSONData struct {
Name string `json:"name"`
Age int `json:"age"`
}
JSONData is our common data struct
with JSON struct tags
Decode will decode into JSONData
ToJSON dumps the JSONData struct to
a JSON format bytes.Buffer
type TOMLData struct {
Name string `toml:"name"`
Age int `toml:"age"`
}
TOMLData is our common data struct
with TOML struct tags
Decode will decode into TOMLData
ToTOML dumps the TOMLData struct to
a TOML format bytes.Buffer
type YAMLData struct {
Name string `yaml:"name"`
Age int `yaml:"age"`
}
YAMLData is our common data struct
with YAML struct tags
Decode will decode into TOMLData
ToYAML dumps the YAMLData struct to
a YAML format bytes.Buffer
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.