unpack_string/hw12_13_14_15_calendar/cmd/calendar/version.go

28 lines
421 B
Go
Raw Normal View History

2023-10-30 15:21:12 +03:00
package main
import (
"encoding/json"
"fmt"
"os"
)
var (
release = "UNKNOWN"
buildDate = "UNKNOWN"
gitHash = "UNKNOWN"
)
func printVersion() {
if err := json.NewEncoder(os.Stdout).Encode(struct {
Release string
BuildDate string
GitHash string
}{
Release: release,
BuildDate: buildDate,
GitHash: gitHash,
}); err != nil {
fmt.Printf("error while decode version info: %v\n", err)
}
}