pressly / goose

A database migration tool. Supports SQL migrations and Go functions.

Home Page:http://pressly.github.io/goose/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running `go run goose` produces go mod error on @latest

willavos opened this issue · comments

If I run go run github.com/pressly/goose/v3/cmd/goose@latest in my terminal, I see the following output.

go run github.com/pressly/goose/v3/cmd/goose@latest
go: downloading github.com/pressly/goose/v3 v3.21.0
go: github.com/pressly/goose/v3/cmd/goose@latest (in github.com/pressly/goose/v3@v3.21.0):
	The go.mod file for the module providing named packages contains one or
	more replace directives. It must not contain directives that would cause
	it to be interpreted differently than if it were the main module.

Seems to be only caused by v3.21.0, v3.20.0 runs fine without any error.

Same problem here! ✋

Same problem here

Thanks for reporting, will fix it immediately. Indeed I put replace directives, but these may not have been removed before the release.

Nothing malicious, was mainly trying to figure out how to pin certain dependencies because newer (minor) versions force us to upgrade the minimum-supported Go version in Goose. Related to #664

Alright, tested this works with the latest commit 3ad1378 I just pushed (which I'll tag as v3.21.1, and retract v3.21.0)

Fwiw go get works just fine, but go run pointing at the module doesn't when there are replace directives. A rabbit hole for another day, but worth it for us to add a test for this to avoid regression in the future. Sorry about that.

$ go run github.com/pressly/goose/v3/cmd/goose@7da8209abd973993f30d5016e74351bfe52e1ce9 --version
go: github.com/pressly/goose/v3/cmd/goose@7da8209abd973993f30d5016e74351bfe52e1ce9 (in github.com/pressly/goose/v3@v3.21.0):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

$ go run github.com/pressly/goose/v3/cmd/goose@3ad137847a4c242f09e425a12c15c7c7961d4b0f --version
goose version: v3.21.1-0.20240619135910-3ad137847a4c

Alright, this should be fixed with the new v3.21.1 release, sorry about the trouble.

Let me know if you have further issues.

$ go run github.com/pressly/goose/v3/cmd/goose@v3.21.1 --version 
go: downloading github.com/pressly/goose/v3 v3.21.1
goose version: v3.21.1

Arr no problem me hearties. Thanks for the quick fix