stillbox/internal/version/version.go

23 lines
409 B
Go
Raw Normal View History

2024-10-18 09:34:20 -04:00
package version
import (
"fmt"
2024-10-21 22:37:44 -04:00
"net/http"
2024-10-18 09:34:20 -04:00
"runtime"
)
var (
2024-10-18 15:21:42 -04:00
Name = "gordio"
2024-10-18 09:34:20 -04:00
Version = "unset"
Built = "unset"
)
func String() string {
return fmt.Sprintf("gordio %s\nbuilt %s for %s-%s\n",
Version, Built, runtime.GOOS, runtime.GOARCH)
}
2024-10-21 22:37:44 -04:00
func UserAgent(hdr http.Header, app string) {
hdr.Set("User-Agent", fmt.Sprintf("stillbox %s/%s (%s/%s)", app, Version, runtime.GOOS, runtime.GOARCH))
}