From eca4a3e92748381df9ae22b07bf00c5825cb01ea Mon Sep 17 00:00:00 2001 From: Lukas Wurzinger Date: Sun, 15 Dec 2024 17:01:07 +0100 Subject: [PATCH] fix --- get.go | 2 ++ summary.tmpl | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/get.go b/get.go index 3d3ed8f..2e0e3a1 100644 --- a/get.go +++ b/get.go @@ -26,6 +26,8 @@ func Get() (Binfo, error) { b.Module.Path = o.Main.Path b.Module.Sum = o.Main.Sum + b.Build.GoVersion = o.GoVersion + for _, setting := range o.Settings { switch setting.Key { case "-buildmode": diff --git a/summary.tmpl b/summary.tmpl index f0bf85e..d3284ea 100644 --- a/summary.tmpl +++ b/summary.tmpl @@ -29,6 +29,12 @@ {{- .Sep -}} -{{- if and .VCS (ne .I.VCS.Name "") -}} - vcs {{ .I.VCS.Name }} (rev {{ .I.VCS.Revision }}) (at {{ .I.VCS.Time.Format "2006-01-02 15:04:05" }}){{- if .I.VCS.Modified }} (modified){{- end -}} +{{- if .VCS -}} + {{- $time := .I.VCS.Time.Format "2006-01-02 15:04:05" -}} + + vcs + {{- if ne .I.VCS.Name "" }} {{ .I.VCS.Name }}{{- end -}} + {{- if ne .I.VCS.Revision "" }} (revision {{ .I.VCS.Revision }}){{- end -}} + {{- if ne $time "" }} (at {{ $time }}){{- end -}} + {{- if .I.VCS.Modified }} (modified){{- end -}} {{- end -}}