Coder Social home page Coder Social logo

Comments (7)

bojan-embroker avatar bojan-embroker commented on July 20, 2024

Isn't this correct behavior? ^1.13.1 means or newer minor or patch version.

from setup-go.

stmcginnis avatar stmcginnis commented on July 20, 2024

That should be documented if that is the expected behavior. It's really unfortunate that ^ was chosen then.

With the README referring to it being a "match", and ^ being a regex match for the start of a line, the expectation was that it would only match exactly a value of 1.13.1 with nothing somehow prepended to it.

If that is not treated as a regex, and it is a symbol used to mean "or greater", then I would expect something like + appended to the end or something that doesn't look like a regex matching string.

Since this has been in place for some time now and there may be folks that expect that behavior, maybe the best way to resolve this at this point is to explicitly call out in the README what it means.

from setup-go.

bojan-embroker avatar bojan-embroker commented on July 20, 2024

^ symbol is coming form the Node.js's dependency management world. I would say authors took it as a universally known syntax, but since it is not standard in Go I agree it should be documented.

Here is the library implementing this version specification syntax that is used by setup-go:
https://www.npmjs.com/package/semver
Its documentation goes into details of ^.

Go's versioning does not work the same Node.js does so there is some mapping between the two done by setup-to which is also not documented, but can found in the code and code comments:

export async function findMatch(

from setup-go.

Sergey-Murtazin avatar Sergey-Murtazin commented on July 20, 2024

Hi @stmcginnis ! Sorry for the late response!
Could you please clarify if the issue is still actual for you?
Thanks!

from setup-go.

stmcginnis avatar stmcginnis commented on July 20, 2024

Thanks for checking @Sergey-Murtazin! I do think this is still confusing, though I understand now that it is an NPM thing. I still think it is really too bad they chose to use something that looks like a regex pattern for a value that performs a match, but it would probably be too disruptive to change at this point.

I read through the README again, and I don't see anything that mentions how this version match is supposed to work. Feel free to close this issue if others don't agree, but I think it would be very useful to update this repo's README to mention how this matching works and link to the explanation that Bojan pointed out.

Allows changes that do not modify the left-most non-zero element in the [major, minor, patch] tuple.

from setup-go.

Sergey-Murtazin avatar Sergey-Murtazin commented on July 20, 2024

Hi, @stmcginnis !

We've updated the documentation.
And as currently written in readme, we are using semver notation.

You can see how to use it here
The ^ sign means that the maximum minor version will be used.

It means that the action works correctly.

If you want to use the maximum 1.13 version, use 1.13.x or 1.13.*

Feel free to contact us if you have any questions.

from setup-go.

Sergey-Murtazin avatar Sergey-Murtazin commented on July 20, 2024

I close this issue because it is resolved

from setup-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.