From e0e183bcb9d54822c67f64b4d6c2a1e967fb3ba9 Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Thu, 24 Mar 2022 16:13:20 +0100 Subject: [PATCH 1/2] Test with Go 1.18 --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 28f0e11d..8f9fe6ad 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ macos-latest, ubuntu-latest] - go_vers: [1.16, 1.17] + go_vers: [1.16, 1.17, 1.18] steps: - uses: actions/checkout@v2 with: From fa0080cf03bec157dec29bbf72da3baf65b19ceb Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Fri, 25 Mar 2022 14:39:41 +0100 Subject: [PATCH 2/2] Fix config.GetSemverInfo() for Go 1.18 In Go 1.18 debug.ReadBuildInfo() may successfully return a build info where the main version is empty. Return the default SemVer in this case. --- pkg/config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 90f316fe..12caac8f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -14,7 +14,7 @@ func GetSemverInfo() string { return SemVer } version, ok := debug.ReadBuildInfo() - if ok && version.Main.Version != "(devel)" { + if ok && version.Main.Version != "(devel)" && version.Main.Version != "" { return version.Main.Version } return _defaultSemVer