mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2024-11-01 04:07:48 +00:00
23 lines
329 B
Go
23 lines
329 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"time"
|
||
|
"encoding/json"
|
||
|
)
|
||
|
|
||
|
type Hacktober struct {
|
||
|
Message string `json:"msg"`
|
||
|
Date time.Time `json:"date"`
|
||
|
}
|
||
|
|
||
|
func main () {
|
||
|
data := Hacktober{
|
||
|
Message: "Hello Hacktoberfest 2018!",
|
||
|
Date: time.Now(),
|
||
|
}
|
||
|
|
||
|
jsonBytes, _ := json.MarshalIndent(data, "", " ")
|
||
|
fmt.Println(string(jsonBytes))
|
||
|
}
|