You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
formatime/customize_test.go

25 lines
396 B

2 years ago
package formatime
import (
"encoding/json"
"log"
"testing"
)
type joo struct {
Name string `json:"name"`
CreatedAt CustomTime `json:"created_at"`
}
func Test_customize(t *testing.T) {
b := joo{
Name: "Joo",
CreatedAt: NewCustomTimeNow("Jan _2 15:04:05.000000000"),
}
text, err := json.Marshal(&b)
if err != nil {
t.Fatal(err)
} else {
log.Print(string(text))
}
}