Skip to content
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

read package path from go.mod if it exists #30

Merged
merged 2 commits into from
Oct 26, 2018

Conversation

rrrkren
Copy link
Contributor

@rrrkren rrrkren commented Oct 23, 2018

this fixes #29

@markbates
Copy link
Owner

Thanks! Can we switch it using this https://godoc.org/github.com/rogpeppe/go-internal/modfile#ModulePath instead? should be more resilient. :)

@rrrkren
Copy link
Contributor Author

rrrkren commented Oct 24, 2018

haha that's some nice round wheels I reinvented, was actually looking for some built in stuff like this. I'll make the changes :)

@rrrkren
Copy link
Contributor Author

rrrkren commented Oct 24, 2018

@markbates what do you think should happen if the go.mod is malformed and the package path cannot be found? Should we return an error or infer it from the current path?

@markbates
Copy link
Owner

if mods are on:

  • go.mod found - read module name
  • go.mod not found - error
  • go.mod malformed -error

If mods are off:

  • infer from path

how's that sound to you?

@rrrkren
Copy link
Contributor Author

rrrkren commented Oct 24, 2018

sounds good :) so we check for GO111MODULE env first?

@markbates
Copy link
Owner

markbates commented Oct 24, 2018 via email

@rrrkren
Copy link
Contributor Author

rrrkren commented Oct 25, 2018

should be working now, using v1.0.0-alpha for go-internal/modfile, only change from 0.0.8 to alpha seems to be changing of name from mod-internal to go-internal.

@markbates markbates merged commit fce0597 into markbates:master Oct 26, 2018
@markbates
Copy link
Owner

Thanks! I noticed another issue when trying this that needs to be fixed before I can cut a release.

@markbates
Copy link
Owner

@rrrkren v1.0.5 should do it! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build fails in go module
2 participants