Giter Site home page Giter Site logo

Wrong module path in go.mod about go-steam HOT 12 CLOSED

gudvinr avatar gudvinr commented on July 17, 2024
Wrong module path in go.mod

from go-steam.

Comments (12)

gudvinr avatar gudvinr commented on July 17, 2024 1

Hopefully everything finally works as intended.

pkg.go.dev now showing correct version:

Version: v2.0.1 Latest
Published: May 1, 2021

from go-steam.

Philipp15b avatar Philipp15b commented on July 17, 2024

I'm not quite sure how to fix this (go modules are somewhat new to me). I want to avoid copying everything in a new v2 subfolder - this is what I believe Git is for. If you have an easy fix, I would very much appreciate a pull request.

from go-steam.

Jleagle avatar Jleagle commented on July 17, 2024

If you are referring to this https://blog.golang.org/v2-go-modules#TOC_4. I don't believe this is the suggested way of doing it. I have never seen a project with a v2 directory. I believe just appending /v2 to the URL in your go.mod should do it.

Examples:
https://github.com/gocolly/colly
https://github.com/grpc-ecosystem/grpc-gateway
https://github.com/ahmdrz/goinsta

from go-steam.

gudvinr avatar gudvinr commented on July 17, 2024

Also replacing github.com/Philipp15b/go-steam with github.com/Philipp15b/go-steam/v2 in import path is necessary too.
etcd is suffering from this too since they added go.mod in v3.3 and didn't fix import path up until v3.5

from go-steam.

Philipp15b avatar Philipp15b commented on July 17, 2024

Thank you both! @gudvinr You mean replacing the import path in every single file that uses it?

What do you both think about just using versions like 1.x, removing version 2.0? It's a hack, but avoids a lot of ridiculously unnecessary work IMHO.

from go-steam.

gudvinr avatar gudvinr commented on July 17, 2024

Thank you both! @gudvinr You mean replacing the import path in every single file that uses it?

That's correct

What do you both think about just using versions like 1.x, removing version 2.0

If v2 contains breaking changes, it'll break working code for v1 users after update. It should be safe to do so if it's not.
Right now there should be a little to no v2 users since go get should pull v1 because v2.0.0 tag does not have a proper module.

In theory you only need to replace import path in the library itself. Right now v2 can only be fetched either for users who use older Go version or if person manages to get code from master branch.

If v2 contains backward incompatible changes it is not unnecessary work though and should be quite trivial to do from any text editor

from go-steam.

Jleagle avatar Jleagle commented on July 17, 2024

#116

from go-steam.

Philipp15b avatar Philipp15b commented on July 17, 2024

Well technically v2 contains breaking changes against v1, but those changes were already a few years old at that point. I will merge #116 though.

from go-steam.

Jleagle avatar Jleagle commented on July 17, 2024

@Philipp15b Hey, any word on merging this in?

from go-steam.

Philipp15b avatar Philipp15b commented on July 17, 2024

Merged it now, thanks for the reminder.

from go-steam.

gudvinr avatar gudvinr commented on July 17, 2024

@Philipp15b I also suggest you to add retraction for v2.0.0 and tag last commit with v2.0.1 or something like that.

It will instruct go tools to avoid v2.0.0 which contains malformed go.mod anyway and v2.0.1 can be finally retrieved through go get like you would usually do.

from go-steam.

Philipp15b avatar Philipp15b commented on July 17, 2024

@gudvinr Thanks for the pointer. I have just released https://github.com/Philipp15b/go-steam/releases/tag/v2.0.1. Hopefully everything finally works as intended.

from go-steam.

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.