diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-06-21 19:06:17 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-06-21 19:06:17 -0700 |
commit | 42f28ab8e374137fe3f5d25424489d879d4724f8 (patch) | |
tree | 20353f2446b506d32e6d353b72a57bf48f070389 /vendor/github.com/pelletier/go-toml/marshal.go | |
parent | 6b39c308d882a0aeac533f8ab1d90b48a2ae4b5a (diff) | |
download | chat-42f28ab8e374137fe3f5d25424489d879d4724f8.tar.gz chat-42f28ab8e374137fe3f5d25424489d879d4724f8.tar.bz2 chat-42f28ab8e374137fe3f5d25424489d879d4724f8.zip |
Updating server dependancies (#6712)
Diffstat (limited to 'vendor/github.com/pelletier/go-toml/marshal.go')
-rw-r--r-- | vendor/github.com/pelletier/go-toml/marshal.go | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/vendor/github.com/pelletier/go-toml/marshal.go b/vendor/github.com/pelletier/go-toml/marshal.go index 358425aea..9bf6fb988 100644 --- a/vendor/github.com/pelletier/go-toml/marshal.go +++ b/vendor/github.com/pelletier/go-toml/marshal.go @@ -9,24 +9,6 @@ import ( "time" ) -/* -Tree structural types and corresponding marshal types -------------------------------------------------------------------------------- -*Tree (*)struct, (*)map[string]interface{} -[]*Tree (*)[](*)struct, (*)[](*)map[string]interface{} -[]interface{} (as interface{}) (*)[]primitive, (*)[]([]interface{}) -interface{} (*)primitive - -Tree primitive types and corresponding marshal types ------------------------------------------------------------ -uint64 uint, uint8-uint64, pointers to same -int64 int, int8-uint64, pointers to same -float64 float32, float64, pointers to same -string string, pointers to same -bool bool, pointers to same -time.Time time.Time{}, pointers to same -*/ - type tomlOpts struct { name string include bool @@ -115,6 +97,22 @@ function for sub-structs, and currently only definite types can be marshaled Note that pointers are automatically assigned the "omitempty" option, as TOML explicity does not handle null values (saying instead the label should be dropped). + +Tree structural types and corresponding marshal types: + + *Tree (*)struct, (*)map[string]interface{} + []*Tree (*)[](*)struct, (*)[](*)map[string]interface{} + []interface{} (as interface{}) (*)[]primitive, (*)[]([]interface{}) + interface{} (*)primitive + +Tree primitive types and corresponding marshal types: + + uint64 uint, uint8-uint64, pointers to same + int64 int, int8-uint64, pointers to same + float64 float32, float64, pointers to same + string string, pointers to same + bool bool, pointers to same + time.Time time.Time{}, pointers to same */ func Marshal(v interface{}) ([]byte, error) { mtype := reflect.TypeOf(v) @@ -247,6 +245,8 @@ func (t *Tree) Unmarshal(v interface{}) error { // is no concept of an Unmarshaler interface or UnmarshalTOML function for // sub-structs, and currently only definite types can be unmarshaled to (i.e. no // `interface{}`). +// +// See Marshal() documentation for types mapping table. func Unmarshal(data []byte, v interface{}) error { t, err := LoadReader(bytes.NewReader(data)) if err != nil { |