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

Obsolete module path for testify? #14

Closed
dmoles opened this issue Jan 28, 2019 · 0 comments
Closed

Obsolete module path for testify? #14

dmoles opened this issue Jan 28, 2019 · 0 comments

Comments

@dmoles
Copy link
Contributor

dmoles commented Jan 28, 2019

Steps to reproduce:

  1. In an existing Go 1.11+ module project, create a new file containing

    import (
    "github.com/martinlindhe/unit"
    )
     
    func init() {
       ft := 1 * unit.Foot
       println(ft)
    }
    
  2. At the console, type go mod tidy

Expected:

  • requirements pulled, go.mod is updated

Actual:

go: finding github.com/martinlindhe/unit latest
go: finding github.com/stretchrcom/testify/assert latest
go: github.com/stretchrcom/testify@v1.3.0: parsing go.mod: unexpected module path "github.com/stretchr/testify"
go: error loading module requirements

Workaround:

  • take a local clone of this repository
  • modify unit_test.go to use stretchr rather than stretchrcom
  • in the module project, add a replace directive to substitute the local clone for github.com/martinlindhe/unit
  • in the local clone, use go mod init to add a go.mod file (replace only works with module projects)
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

No branches or pull requests

1 participant