When registering routes on "iris.Application", I get "iris.Context" errors like ".../main.go:14 undefined: iris.Context" even though "github.com/kataras/iris" has been imported. Changing to import "github.com/kataras/iris/context" and using "context.Context" seems to fix this, but I haven't found any docs that explain this change... Is this just a oversight of refactoring, or am I missing something?
Yes, it is now context.Context
I assume that you're using the go version 1.8 and try to use the new type alias iris.Context (introduced at go 1.9) instead of the context.Context from "github.com/kataras/iris/context".
The docs are updated to go 1.9, the real context is located at context.Context so use it as import "github.com/kataras/iris/context" BUT if you're using go version 1.9 you can use the iris.Context instead and omit the context import statement because it's a type alias, a new feature.
The iris.Context is described at the README.md under the Hello World with Go 1.8 section, if you're hosting from go 1.8 it tells you why you want to import the context package.
@krokite It was always context.Context the @adamjaso 's question was about docs because they see iris.Context but as I noted at the first paragraph: all docs and examples are updated to go 1.9 with the iris.Context type alias. Although we kept a section on README for new gophers who using the old go version and have no idea about type alias, as well.
At the end, both iris.Context and context.Context works exactly the same, it's the same type, so it's your choice if you want to import the context package or just use the iris.Context (if go >= 1.9). Simple enough.
Most helpful comment
I assume that you're using the go version 1.8 and try to use the new type alias
iris.Context(introduced at go 1.9) instead of thecontext.Contextfrom "github.com/kataras/iris/context".The docs are updated to go 1.9, the real context is located at
context.Contextso use it asimport "github.com/kataras/iris/context"BUT if you're using go version 1.9 you can use theiris.Contextinstead and omit the context import statement because it's a type alias, a new feature.The
iris.Contextis described at the README.md under theHello World with Go 1.8section, if you're hosting from go 1.8 it tells you why you want to import thecontextpackage.@krokite It was always
context.Contextthe @adamjaso 's question was about docs because they seeiris.Contextbut as I noted at the first paragraph: all docs and examples are updated to go 1.9 with theiris.Contexttype alias. Although we kept a section on README for new gophers who using the old go version and have no idea about type alias, as well.At the end, both
iris.Contextandcontext.Contextworks exactly the same, it's the same type, so it's your choice if you want to import thecontextpackage or just use theiris.Context(if go >= 1.9). Simple enough.