Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Example ¶
package main import ( "bytes" "encoding/json" "fmt" "github.com/komkom/toml" ) func main() { doc := ` [some] toml="doc" [to.map] "!"=true` dec := json.NewDecoder(toml.New(bytes.NewBufferString(doc))) st := struct { Some struct { Toml string `json:"toml"` } `json:"some"` To struct { Map struct { IsMarked bool `json:"!"` } } `json:"to"` }{} err := dec.Decode(&st) if err != nil { panic(err) } fmt.Printf("toml: %v", st.Some.Toml) fmt.Printf(" is_marked: %v", st.To.Map.IsMarked) }
Output: toml: doc is_marked: true
Click to show internal directories.
Click to hide internal directories.