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

[POLL] Iris + Go Modules (Import path suffix or not) #1370

Open
kataras opened this issue Oct 3, 2019 · 0 comments

Comments

@kataras
Copy link
Owner

commented Oct 3, 2019

Hello Iris Community,

As you know the Go Team released the go modules.

There are two opened issues:

I would like to have your opinion on a serious subject about the import path. There are two ways to fix the above.

The first one is to keep the same import path and do:

$ go get github.com/kataras/iris@master

This will add a pseudo-version inside your project's go.mod:

require (
        github.com/kataras/iris v0.0.0-20191005193354-55afd07befa8
)

The import paths inside your program should look like that:

package mypackage

import "github.com/kataras/iris"
import "github.com/iris-contrib/middleware/cloudwatch"

However, tools like go mod tidy or if someone tried go get github.com/kataras/iris@v11.2.8 will fail after go 1.3 because it does not contain the version suffix.

The second solution one is to increment the major version, replace and keep updating all import paths inside Iris and iris-contrib/middleware, iris-contrib/examples and e.t.c. to github.com/kataras/iris/v12 (see the version suffix, which can be a git branch or tag of this repository).

$ go get github.com/kataras/iris@v12

This should download the latest tagged version of v12.

The go.mod can look like that:

require(
    github.com/kataras/iris v12.0.0
)
package mypackage

import "github.com/kataras/iris/v12"
import "github.com/iris-contrib/middleware/cloudwatch/v12"
// [...]

There are several downsides of changing the import path, as it is a huge breaking change but in the same time it's the standard Go's way nowadays.


Please think of it and vote up what you would like to happen here.


Yours,
Gerasimos Maropoulos, Author of Iris.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.