Files
go-cv/version.go
Bryan Joshua Pedini 7f09e3dae1
All checks were successful
Push to GitHub / mirror (push) Successful in 4s
Template updates (commit: 11682a3)
2025-12-31 23:14:22 +01:00

27 lines
494 B
Go

package main
import (
_ "embed"
"html/template"
"net/http"
)
//go:embed templates/html/version.html
var versionTemplate string
func handleVersion(w http.ResponseWriter, r *http.Request) {
type SiteInfo struct {
CommitId string
Name string
Version string
}
tmpl, _ := template.New("version.html").Parse(versionTemplate)
// Return (write) the version to the response body
tmpl.Execute(w, SiteInfo{
CommitId: COMMIT_ID,
Name: "YASKM",
Version: APP_VERSION,
})
}