...

Source file src/github.com/clbanning/mxj/v2/examples/goofy_map.go

Documentation: github.com/clbanning/mxj/v2/examples

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/clbanning/mxj"
     7  )
     8  
     9  func main() {
    10  	data := map[interface{}]interface{}{
    11  		"hello": "out there",
    12  		1:       "number one",
    13  		3.12:    "pi",
    14  		"five":  5,
    15  	}
    16  
    17  	m, err := mxj.AnyXmlIndent(data,"", "   ")
    18  	if err != nil {
    19  		fmt.Println(err)
    20  		return
    21  	}
    22  	fmt.Println(string(m))
    23  }
    24  

View as plain text