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.
25 lines
396 B
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))
|
||
|
}
|
||
|
}
|