Skip to content

Instantly share code, notes, and snippets.

@ready4god2513
Created October 2, 2014 04:39
Show Gist options
  • Save ready4god2513/9fef505cb90b3c2cdd26 to your computer and use it in GitHub Desktop.
Save ready4god2513/9fef505cb90b3c2cdd26 to your computer and use it in GitHub Desktop.
package main
import (
"encoding/json"
"fmt"
)
type Person struct {
Name string `json:"name" xml:"name"`
Gender string `json:"gender" xml:"gender"`
}
func main() {
person := &Person{"Brandon", "Male"}
data, _ := json.Marshal(person)
fmt.Println(string(data))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment