-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --replace
argument
#33
Conversation
8a99dde
to
d45ef64
Compare
`--replace` can be used multiple times to add replacements by specifying the Go module name and the replacement module, similar to `go mod edit -replace=`. Version of the replacement can be specified with the `@version` suffix in the replacement path. Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
d45ef64
to
14e662c
Compare
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! It LGTM, just have some style suggestions.
I'd like for @mstoykov to take a look before merging, just in case we're missing something or if there's a simpler way of doing this.
if got == "." { | ||
t.Errorf("did not expand path") | ||
} | ||
if err != nil { | ||
t.Errorf("failed to expand path") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, we're not using stretchr/testify
in the project yet 😞 Otherwise this would be simpler using require.NoError()
and assert.NotEqual()
.
It's fine leaving it as is. We can change this everywhere once we add testify
as a dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR 🙇
I kind of feel it will be nice if when we clean inputs (for example removing /
) we actually tell users that this was done, just in case our assumptions about it not being valid come out to be false. But I also think in this case it's probably fine
--replace
can be used multiple times to add replacements by specifyingthe Go module name and the replacement module, similar to
go mod edit -replace=
. Version of the replacement can be specified with the@version
suffix in the replacement path.Fixes #32
Signed-off-by: Christian Haudum christian.haudum@gmail.com