package main

import (
	"encoding/json"
	"log"
	"os"
)

// section: code
type User struct {
	ID       int
	Name     string
	Phone    string
	Password string
}

func main() {
	u := User{
		ID:       1,
		Name:     "Rob Pike",
		Password: "goIsAwesome",
	}

	err := json.NewEncoder(os.Stdout).Encode(&u)
	if err != nil {
		log.Fatal(err)
	}
}

// section: code

/*
// section: output
{"ID":1,"Name":"Rob Pike","Phone":"","Password":"goIsAwesome"}
// section: output
*/
