MarshalJSONを使ってJSONに表示用のフィールドを追加する 無限ループしないように元の構造体を拡張する // UTCな時間をJsonに変換するタイミングでJSTに変換する例 import "time" type Hoge struct { ID uint CreatedAt time.Time } func (h Hoge) MarshalJSON() ([]byte, error) { type Alias Hoge return json.Marshal(&struct { Alias CreatedAtJST time.Time }{ Alias: (Alias)(h), CreatedAtJST: h.CreatedAt.In(time.LoadLocation("Asia/Tokyo")), } } 参考 Custom JSON Marshalling in Go ·