feat: add verifier version to vsa

This commit is contained in:
mrjoelkamp
2024-10-16 12:01:31 -05:00
parent e39a4ea9f3
commit 84c0b116a7
6 changed files with 65 additions and 13 deletions

View File

@@ -9,9 +9,19 @@ import (
const ThisModulePath = "github.com/docker/attest"
type Fetcher interface {
Get() (*semver.Version, error)
}
type GoModVersionFetcher struct{}
func NewGoVersionFetcher() *GoModVersionFetcher {
return &GoModVersionFetcher{}
}
// Get returns the version of the attest module.
// this can return nil if the version can't be determined (without an error).
func Get() (*semver.Version, error) {
func (*GoModVersionFetcher) Get() (*semver.Version, error) {
var attestMod *debug.Module
bi, ok := debug.ReadBuildInfo()
if !ok {