package main

import (
	"encoding/xml"
	"fmt"
	"log"
)

// TODO: create a custom type called `password` that is derived from the `string` type
type password string

// TODO: satisfy the `TextMarshaller` interface on the `password` type to always
//       return a constant value of ********
func (p password) MarshalText() ([]byte, error) {
	return []byte("********"), nil
}

type User struct {
	ID       int
	Name     string
	Password password // TODO: change the type to your new type of `password`
}

func main() {
	u := User{
		ID:       1,
		Name:     "Jill Rogers",
		Password: "ksd*23k21!",
	}

	b, err := xml.Marshal(u)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(string(b))
}
