Problem with the new update


#1

package github.com/labstack/echo/v4: cannot find package “github.com/labstack/echo/v4” in any of:
/usr/lib/go-1.10/src/github.com/labstack/echo/v4 (from $GOROOT)
/var/lib/jenkins/jobs/customermanagement/builds/11/src/github.com/labstack/echo/v4 (from $GOPATH)

Why is this happening ?
Since I updated this morning. All our servers using echo are not building anymore!


#2

Can confirm, also seeing this issue.


#3

This is a major release, you should not update blindly without reading the release notes.

Please refer to the release notes: https://github.com/labstack/echo/releases/tag/v4.0.0 and the README: https://github.com/labstack/echo/blob/v4.0.0/README.md#supported-go-versions which clearly indicates the compatibility requirements. If you cannot upgrade your Go version, then do not upgrade to v4, continue using the latest v3 version which is: https://github.com/labstack/echo/releases/tag/v3.3.10

We follow semver closely, bumping up the MAJOR version DOES indeed indicate breaking changes.

Hope this helps!


#4

Not familiar with forcing versions here - all our files just have import on “github.com/labstack/echo” without specifying a version. Likewise we use go get github/labstack/echo in our docker builds… and this has always worked until the change in labstack I guess. The error about v4 is not really me trying to upgrade. So your comment indicating we shouldn’t update blindly - how do we not? I didn’t change anything…

As I’m new - how to I force it down to v3.3.10? Please advise. I don’t see any import like github.com/labstack/echo/v3

Thanks,
Dan C.


#5

Without specifying a version and/or using a dependency management solution, it’s just a matter of time before things break. This is not just about Echo in particular, any project can introduce breaking changes and if you’re not prepared for that, you end up exactly as you did now: with a broken build.

My recommendation would be to learn about dependency management and pick some solution. Finally, Go has an official one: https://github.com/golang/go/wiki/Modules

To get your build back working quickly you can do one of two things (off the top of my head):

  1. upgrade Go to one of the supported versions: https://github.com/labstack/echo#supported-go-versions or
  2. vendor Echo in your project:
 $ git clone https://github.com/labstack/echo.git
 $ cd echo
 $ git checkout v3.3.10
 $ cd ..
 $ rm -rfv echo/.git # echo's own .git will just be in the way
 $ mkdir -p <your_project>/vendor/github.com/labstack
 $ mv echo <your_project>/vendor/github.com/labstack/
 ... test it, commit, etc.

From that point on, you have your own copy of Echo which you can upgrade at your own pace, AFTER you have tested that it does not break things. That’s what dependency management can do for you, except that this one is kind of manual. There are better ways (suggested above).

Of course, if you can update the Go version, that’s even better.


#6

Ok using tags/v3.3.9 everything builds all right