petergtz / pegomock

Pegomock is a powerful, yet simple mocking framework for the Go programming language
Apache License 2.0
252 stars 28 forks source link

Installation instructions are out of date #121

Closed Dithilli closed 1 year ago

Dithilli commented 1 year ago

go get no longer works, and people should use go install github.com/petergtz/pegomock/pegomock@latest

I was going to submit a PR to update it but I can't seem to.

petergtz commented 1 year ago

Hey @Dithilli, thanks for reporting this. Indeed, go get is not appropriate for installing the pegomock binary anymore.

I was going to submit a PR to update it but I can't seem to.

What was the problem? You should be able to just edit the README and GitHub will create a fork for you where you can make the change and open a PR. Did you try that?

Dithilli commented 1 year ago

I did and for some reason I was getting permissions errors. Let me try again. Sent from my iPhoneOn Feb 7, 2023, at 4:50 AM, Peter Götz @.***> wrote: Hey @Dithilli, thanks for reporting this. Indeed, go get is not appropriate for installing the pegomock binary anymore.

I was going to submit a PR to update it but I can't seem to.

What was the problem? You should be able to just edit the README and GitHub will create a fork for you where you can make the change and open a PR. Did you try that?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

gurpreetseedhar commented 1 year ago

Hey, I am having trouble with installation via go install as well.

go install `github.com/petergtz/pegomock/pegomock@latest`
go: finding module for package golang.org/x/tools/go/loader
go: finding module for package gopkg.in/alecthomas/kingpin.v2
go: found gopkg.in/alecthomas/kingpin.v2 in gopkg.in/alecthomas/kingpin.v2 v2.3.1
go: found golang.org/x/tools/go/loader in golang.org/x/tools v0.6.0
go: github.com/petergtz/pegomock/pegomock imports
        gopkg.in/alecthomas/kingpin.v2: gopkg.in/alecthomas/kingpin.v2@v2.3.1: parsing go.mod:
        module declares its path as: github.com/alecthomas/kingpin/v2
                but was required as: gopkg.in/alecthomas/kingpin.v2
petergtz commented 1 year ago

Hey @gurpreetseedhar, would you be willing to submit a pull-request?

llamahunter commented 1 year ago

Is this project abandoned? Does not install, does not run w/o crashing.

petergtz commented 1 year ago

Hey @llamahunter, @gurpreetseedhar, @Dithilli,

I've just released a new major version with Go modules support and updated installation instructions. Does this fix your issues?

@llamahunter If things are still crashing for you, can paste some output here? (I realize error handling could be better in some parts, where you only get a panic. I'd be happy to fix those, if you paste them here.)

llamahunter commented 1 year ago

@llamahunter If things are still crashing for you, can paste some output here? (I realize error handling could be better in some parts, where you only get a panic. I'd be happy to fix those, if you paste them here.)

I found that if I rolled back to golang 1.16, it would run without crashing. I had tried to patch up the current code and make a PR, but couldn't figure out how to get the repo to build.

There were also discrepancies in some upstream packages between github.com and gopkg.in urls. Did that get fixed?

Will try again with the latest release. Have the installation notes in the README been updated? They still referred to things like 'go get' last I checked.

petergtz commented 1 year ago

@llamahunter

I had tried to patch up the current code and make a PR, but couldn't figure out how to get the repo to build.

Agree, it was pretty hard to get it to build with current Go versions and dependencies etc. Needed lots of changes. It's building and running tests successfully now. I'm still working on the GitHub action, which seems to have some problems still.

There were also discrepancies in some upstream packages between github.com and gopkg.in urls. Did that get fixed?

Yes, I fixed that too.

Have the installation notes in the README been updated?

Yes. See section Installing Pegomock and Getting Started in there.

petergtz commented 1 year ago

Sorry, I take it back. The versioning introduced some issues. Will post again here, when it's fixed.

petergtz commented 1 year ago

@llamahunter Okay, fixed the bug, GH action is green. Would be very happy to hear if it works for you now.

llamahunter commented 1 year ago

Ok, works now. Had some mysterious errors about some things not working (e.g. with Whenever()) because there were other imports I needed to update from github.com/petergtz/pegomock to github.com/petergtz/pegomock/v3 (especially the ginko_compatible one). Might mention that in an 'upgrade from previous version' step?

petergtz commented 1 year ago

Good idea to add a migration guide. I mentioned the necessary steps in the release description, but no one reads that probably 🙂

llamahunter commented 1 year ago

Good idea to add a migration guide. I mentioned the necessary steps in the release description, but no one reads that probably 🙂

Ah, I often do look at release descriptions for stuff that frequently updates with breaking changes, but for a rare change, and especially a major change, I expect the README.md to say something about 'v2 to v3 migration guide', which, in this case, could just link to the release description.

petergtz commented 1 year ago

Makes sense. Done.

petergtz commented 1 year ago

I'm closing this issue now. Anyone please feel free if you think the problem is not solved.