Created
November 22, 2024 03:18
-
-
Save nikolaydubina/f745b60a7a81f12785e0108e5f7dc190 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// yes | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"time" | |
) | |
type S struct { | |
T time.Time `json:"ts,omitempty"` | |
} | |
func main() { | |
var s S | |
b, _ := json.Marshal(s) | |
fmt.Println(string(b)) | |
// Output: {"ts":"0001-01-01T00:00:00Z"} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment