badges / shields

Concise, consistent, and legible badges in SVG and raster format
https://shields.io
Creative Commons Zero v1.0 Universal
23.74k stars 5.5k forks source link

Go modules showing the same version number #10442

Closed scottschreckengaust closed 2 months ago

scottschreckengaust commented 2 months ago

Are you experiencing an issue with...

shields.io

🐞 Description

The version for Go modules are all the "same" currently showing v1.18 at the time of writing.

🔗 Link to the badge

https://shields.io/badges/git-hub-go-mod-go-version

Here are two examples (at the time both showing v1.18:

  1. GitHub go.mod Go version should be v0.85.0
  2. GitHub go.mod Go version should be v0.1.238

Screenshot: image

💡 Possible Solution

No response

scottschreckengaust commented 2 months ago

I see that go 1.18 is in the go.mod files...maybe that is the "issue"...should it be reading the version file instead?

Example based on the two examples above?:

  1. https://github.com/projen/projen-go/blob/main/projen/version
  2. https://github.com/cdklabs/generative-ai-cdk-constructs-go/blob/main/generative-ai-cdk-constructs/version
chris48s commented 2 months ago

The badge you're requesting shows the supported go version for the given repo, not the package version itself. So these are working as expected. So if you request https://img.shields.io/github/go-mod/go-version/gohugoio/hugo for example, it will tell you v1.21.8 which is correct https://github.com/gohugoio/hugo/blob/665ac949bdc2e54d378ef5c00778c830440a1a9d/go.mod#L172

There is one issue here though, which is that the documentation page for this should be under the "Platform & Version Support" category, not "Version" which probably led to the confusion here. I've submitted https://github.com/badges/shields/pull/10444 fixing that.

scottschreckengaust commented 2 months ago

So grateful for the rapid response. I'll use the GitHub tag method instead to derive the package version.