hacktoberfest-2018/code/hacktober.go

23 lines
329 B
Go
Raw Normal View History

2018-10-06 23:43:31 +00:00
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))
}