From 80952bcbd5fc1fe785f65a593fc8e52b965da9e9 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Tue, 6 Nov 2018 04:36:05 +0200 Subject: [PATCH] Add the article 'CRUD REST API in Iris (a framework for golang)' and a starter kit for Iris written by @jebzmos4 Former-commit-id: 72eb72f11086b23c1bf849eb14ad846492a84cbd --- README.md | 18 ++++++++++-------- README_GR.md | 18 ++++++++++-------- README_ID.md | 18 ++++++++++-------- README_JPN.md | 18 ++++++++++-------- README_PT_BR.md | 18 ++++++++++-------- README_RU.md | 18 ++++++++++-------- README_ZH.md | 18 ++++++++++-------- middleware/i18n/i18n.go | 5 ++--- sessions/sessiondb/boltdb/database.go | 9 +++------ sessions/sessiondb/redis/service/service.go | 3 ++- 10 files changed, 77 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index f0bdff28..d8e4eae7 100644 --- a/README.md +++ b/README.md @@ -967,14 +967,15 @@ First of all, the most correct way to begin with a web framework is to learn the | Quickstart for Iris with Nanobox | https://guides.nanobox.io/golang/iris/from-scratch | --> -1. [A basic web app built in Iris for Go](https://github.com/gauravtiwari/go_iris_app) -2. [A mini social-network created with the awesome Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) -3. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) -4. [Demo project with react using typescript and Iris](https://github.com/ionutvilie/react-ts) -5. [Self-hosted Localization Management Platform built with Iris and Angular](https://github.com/iris-contrib/parrot) -6. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) -7. [Quickstart for Iris with Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) -8. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) +1. [A basic CRUD API in golang with Iris](https://github.com/jebzmos4/Iris-golang) +2. [A basic web app built in Iris for Go](https://github.com/gauravtiwari/go_iris_app) +3. [A mini social-network created with the awesome Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) +4. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) +5. [Demo project with react using typescript and Iris](https://github.com/ionutvilie/react-ts) +6. [Self-hosted Localization Management Platform built with Iris and Angular](https://github.com/iris-contrib/parrot) +7. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) +8. [Quickstart for Iris with Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) +9. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) > Did you build something similar? Let us [know](https://github.com/kataras/iris/pulls)! @@ -986,6 +987,7 @@ Iris, unlike others, is 100% compatible with the standards and that's why the ma ### Articles +* [CRUD REST API in Iris (a framework for golang)](https://medium.com/@jebzmos4/crud-rest-api-in-iris-a-framework-for-golang-a5d33652401e) * [A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064) * [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://bit.ly/2lmKaAZ) * [Top 6 web frameworks for Go as of 2017](https://blog.usejournal.com/top-6-web-frameworks-for-go-as-of-2017-23270e059c4b) diff --git a/README_GR.md b/README_GR.md index b71b305b..abe0b61d 100644 --- a/README_GR.md +++ b/README_GR.md @@ -182,14 +182,15 @@ _Η τελευταία ενημέρωση έγινε την [Τρίτη, 21 Νο | Quickstart for Iris with Nanobox | https://guides.nanobox.io/golang/iris/from-scratch | --> -1. [A basic web app built in Iris for Go](https://github.com/gauravtiwari/go_iris_app) -2. [A mini social-network created with the awesome Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) -3. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) -4. [Demo project with react using typescript and Iris](https://github.com/ionutvilie/react-ts) -5. [Self-hosted Localization Management Platform built with Iris and Angular](https://github.com/iris-contrib/parrot) -6. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) -7. [Quickstart for Iris with Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) -8. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) +1. [A basic CRUD API in golang with Iris](https://github.com/jebzmos4/Iris-golang) +2. [A basic web app built in Iris for Go](https://github.com/gauravtiwari/go_iris_app) +3. [A mini social-network created with the awesome Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) +4. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) +5. [Demo project with react using typescript and Iris](https://github.com/ionutvilie/react-ts) +6. [Self-hosted Localization Management Platform built with Iris and Angular](https://github.com/iris-contrib/parrot) +7. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) +8. [Quickstart for Iris with Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) +9. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) > Έχετε χτίσει κάτι παρόμοιο; [Ενημέρωσέ μας](https://github.com/kataras/iris/pulls)! @@ -201,6 +202,7 @@ _Η τελευταία ενημέρωση έγινε την [Τρίτη, 21 Νο ### Articles +* [CRUD REST API in Iris (a framework for golang)](https://medium.com/@jebzmos4/crud-rest-api-in-iris-a-framework-for-golang-a5d33652401e) * [A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064) * [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](bit.ly/2lmKaAZ) * [Top 6 web frameworks for Go as of 2017](https://blog.usejournal.com/top-6-web-frameworks-for-go-as-of-2017-23270e059c4b) diff --git a/README_ID.md b/README_ID.md index f4789168..52586d7f 100644 --- a/README_ID.md +++ b/README_ID.md @@ -180,14 +180,15 @@ Pertama - tama, cara yang paling tepat untuk memulai dengan web framework adalah | Quickstart for Iris with Nanobox | https://guides.nanobox.io/golang/iris/from-scratch | --> -1. [A basic web app built in Iris for Go](https://github.com/gauravtiwari/go_iris_app) -2. [A mini social-network created with the awesome Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) -3. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) -4. [Demo project with react using typescript and Iris](https://github.com/ionutvilie/react-ts) -5. [Self-hosted Localization Management Platform built with Iris and Angular](https://github.com/iris-contrib/parrot) -6. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) -7. [Quickstart for Iris with Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) -8. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) +1. [A basic CRUD API in golang with Iris](https://github.com/jebzmos4/Iris-golang) +2. [A basic web app built in Iris for Go](https://github.com/gauravtiwari/go_iris_app) +3. [A mini social-network created with the awesome Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) +4. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) +5. [Demo project with react using typescript and Iris](https://github.com/ionutvilie/react-ts) +6. [Self-hosted Localization Management Platform built with Iris and Angular](https://github.com/iris-contrib/parrot) +7. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) +8. [Quickstart for Iris with Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) +9. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) > Apakah anda membuat hal yang serupa? [Beritahu kami](https://github.com/kataras/iris/pulls)! @@ -199,6 +200,7 @@ Iris, tidak seperti yang lain, 100% compatible dengan standards dan maka dari it ### Articles +* [CRUD REST API in Iris (a framework for golang)](https://medium.com/@jebzmos4/crud-rest-api-in-iris-a-framework-for-golang-a5d33652401e) * [A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064) * [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://bit.ly/2lmKaAZ) * [Top 6 web frameworks for Go as of 2017](https://blog.usejournal.com/top-6-web-frameworks-for-go-as-of-2017-23270e059c4b) diff --git a/README_JPN.md b/README_JPN.md index e9f902ad..275d30c1 100644 --- a/README_JPN.md +++ b/README_JPN.md @@ -180,14 +180,15 @@ Irisプロジェクトに貢献して頂ける方は、[CONTRIBUTING.md](CONTRIB | Quickstart for Iris with Nanobox | https://guides.nanobox.io/golang/iris/from-scratch | --> -1. [A basic web app built in Iris for Go](https://github.com/gauravtiwari/go_iris_app) -2. [A mini social-network created with the awesome Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) -3. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) -4. [Demo project with react using typescript and Iris](https://github.com/ionutvilie/react-ts) -5. [Self-hosted Localization Management Platform built with Iris and Angular](https://github.com/iris-contrib/parrot) -6. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) -7. [Quickstart for Iris with Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) -8. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) +1. [A basic CRUD API in golang with Iris](https://github.com/jebzmos4/Iris-golang) +2. [A basic web app built in Iris for Go](https://github.com/gauravtiwari/go_iris_app) +3. [A mini social-network created with the awesome Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) +4. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) +5. [Demo project with react using typescript and Iris](https://github.com/ionutvilie/react-ts) +6. [Self-hosted Localization Management Platform built with Iris and Angular](https://github.com/iris-contrib/parrot) +7. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) +8. [Quickstart for Iris with Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) +9. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) > 似たようなものを開発しましたか? [私たちにも教えてください!](https://github.com/kataras/iris/pulls) @@ -199,6 +200,7 @@ Irisは他のフレームワークと異なり、標準パッケージと10 ### 記事 +* [CRUD REST API in Iris (a framework for golang)](https://medium.com/@jebzmos4/crud-rest-api-in-iris-a-framework-for-golang-a5d33652401e) * [A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064) * [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://bit.ly/2lmKaAZ) * [Top 6 web frameworks for Go as of 2017](https://blog.usejournal.com/top-6-web-frameworks-for-go-as-of-2017-23270e059c4b) diff --git a/README_PT_BR.md b/README_PT_BR.md index 29afcb5e..4155b293 100644 --- a/README_PT_BR.md +++ b/README_PT_BR.md @@ -185,14 +185,15 @@ padrão. Feito isso, você pode seguir as seguintes diretrizes: | Quickstart do Iris com Nanobox | https://guides.nanobox.io/golang/iris/from-scratch | --> -1. [Web app básico utilizando o Iris](https://github.com/gauravtiwari/go_iris_app) -2. [Uma mini rede social criada com o incrível Iris💖💖] (https://github.com/iris-contrib/Iris-Mini-Social-Network) -3. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) -4. [Projeto demo usando react com typescript e Iris](https://github.com/ionutvilie/react-ts) -5. [Plataforma de Gerenciamento de Localização auto hospedada criada com Iris e Angular](https://github.com/iris-contrib/parrot) -6. [Iris + Docker e Kubernetes](https://github.com/iris-contrib/cloud-native-go) -7. [Quickstart do Iris com Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) -8. [Um projeto Hasura para iniciantes pronto para o deply com um app Golang hello-world utilizando o IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) +1. [A basic CRUD API in golang with Iris](https://github.com/jebzmos4/Iris-golang) +2. [Web app básico utilizando o Iris](https://github.com/gauravtiwari/go_iris_app) +3. [Uma mini rede social criada com o incrível Iris💖💖] (https://github.com/iris-contrib/Iris-Mini-Social-Network) +4. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) +5. [Projeto demo usando react com typescript e Iris](https://github.com/ionutvilie/react-ts) +6. [Plataforma de Gerenciamento de Localização auto hospedada criada com Iris e Angular](https://github.com/iris-contrib/parrot) +7. [Iris + Docker e Kubernetes](https://github.com/iris-contrib/cloud-native-go) +8. [Quickstart do Iris com Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) +9. [Um projeto Hasura para iniciantes pronto para o deply com um app Golang hello-world utilizando o IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) > Voce criou algo parecido ? [Informe-nos](https://github.com/kataras/iris/pulls)! @@ -204,6 +205,7 @@ Iris, ao contrário dos demais, é 100% compatível com os padrões e esse é o ### Artigos +* [CRUD REST API in Iris (a framework for golang)](https://medium.com/@jebzmos4/crud-rest-api-in-iris-a-framework-for-golang-a5d33652401e) * [Um aplicação Todo utilizando Iris e Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064) * [Um projeto Hasura para iniciantes pronto para o deply com um app Golang hello-world utilizando o IRIS](https://bit.ly/2lmKaAZ) * [Top 6 frameworks web do Go em 2017](https://blog.usejournal.com/top-6-web-frameworks-for-go-as-of-2017-23270e059c4b) diff --git a/README_RU.md b/README_RU.md index b9578599..3639728e 100644 --- a/README_RU.md +++ b/README_RU.md @@ -180,14 +180,15 @@ _Обновлено: [Вторник, 21 ноября 2017 г.](_benchmarks/READ | Quickstart for Iris with Nanobox | https://guides.nanobox.io/golang/iris/from-scratch | --> -1. [Основное веб-приложение, созданное в Iris for Go](https://github.com/gauravtiwari/go_iris_app) -2. [Мини-социальная сеть, созданная с удивительным Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) -3. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) -4. [Демо-проект с реакцией на использованием машинописного текста и Iris](https://github.com/ionutvilie/react-ts) -5. [Самостоятельная платформа управления локализацией, построенная с помощью Iris и Angular](https://github.com/iris-contrib/parrot) -6. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) -7. [Быстрый запуск для Iris с Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) -8. [Cтартовый проект Hasura с готовностью применять веб-приложение Golang hello-world с IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) +1. [A basic CRUD API in golang with Iris](https://github.com/jebzmos4/Iris-golang) +2. [A basic web app built in Iris for Go](https://github.com/gauravtiwari/go_iris_app) +3. [A mini social-network created with the awesome Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) +4. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) +5. [Demo project with react using typescript and Iris](https://github.com/ionutvilie/react-ts) +6. [Self-hosted Localization Management Platform built with Iris and Angular](https://github.com/iris-contrib/parrot) +7. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) +8. [Quickstart for Iris with Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) +9. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) > Вы построили что-то подобное? Дайте нам [знать](https://github.com/kataras/iris/pulls)! @@ -199,6 +200,7 @@ Iris, в отличие от других, на 100% совместим со с ### Статьи +* [CRUD REST API in Iris (a framework for golang)](https://medium.com/@jebzmos4/crud-rest-api-in-iris-a-framework-for-golang-a5d33652401e) * [Приложение Todo MVC с использованием Iris и Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064) * [Стартовый проект Hasura с готовностью применять веб-приложение Golang hello-world с IRIS](bit.ly/2lmKaAZ) * [Топ-6 веб-фреймворков для Go на 2017 год diff --git a/README_ZH.md b/README_ZH.md index 100c39f2..40dbf190 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -175,14 +175,15 @@ _更新于: [2017年11月21日星期二](_benchmarks/README_UNIX.md)_ | Quickstart for Iris with Nanobox | https://guides.nanobox.io/golang/iris/from-scratch | --> -1. [A basic web app built in Iris for Go](https://github.com/gauravtiwari/go_iris_app) -2. [A mini social-network created with the awesome Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) -3. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) -4. [Demo project with react using typescript and Iris](https://github.com/ionutvilie/react-ts) -5. [Self-hosted Localization Management Platform built with Iris and Angular](https://github.com/iris-contrib/parrot) -6. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) -7. [Quickstart for Iris with Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) -8. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) +1. [A basic CRUD API in golang with Iris](https://github.com/jebzmos4/Iris-golang) +2. [A basic web app built in Iris for Go](https://github.com/gauravtiwari/go_iris_app) +3. [A mini social-network created with the awesome Iris💖💖](https://github.com/iris-contrib/Iris-Mini-Social-Network) +4. [Iris isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/iris-contrib/iris-starter-kit) +5. [Demo project with react using typescript and Iris](https://github.com/ionutvilie/react-ts) +6. [Self-hosted Localization Management Platform built with Iris and Angular](https://github.com/iris-contrib/parrot) +7. [Iris + Docker and Kubernetes](https://github.com/iris-contrib/cloud-native-go) +8. [Quickstart for Iris with Nanobox](https://guides.nanobox.io/golang/iris/from-scratch) +9. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](https://hasura.io/hub/project/hasura/hello-golang-iris) > 如果你有类似的使用经验吗 [请提交给我们](https://github.com/kataras/iris/pulls)! @@ -192,6 +193,7 @@ Iris 拥有大量的中间件 [[1]](middleware/)[[2]](https://github.com/iris-co ### 相关文章(英文) +* [CRUD REST API in Iris (a framework for golang)](https://medium.com/@jebzmos4/crud-rest-api-in-iris-a-framework-for-golang-a5d33652401e) * [A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064) * [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](bit.ly/2lmKaAZ) * [Top 6 web frameworks for Go as of 2017](https://blog.usejournal.com/top-6-web-frameworks-for-go-as-of-2017-23270e059c4b) diff --git a/middleware/i18n/i18n.go b/middleware/i18n/i18n.go index 4fef4470..923398ea 100644 --- a/middleware/i18n/i18n.go +++ b/middleware/i18n/i18n.go @@ -19,10 +19,8 @@ type i18nMiddleware struct { func (i *i18nMiddleware) ServeHTTP(ctx context.Context) { wasByCookie := false - language := i.config.Default - langKey := ctx.Application().ConfigurationReadOnly().GetTranslateLanguageContextKey() - language = ctx.Values().GetString(langKey) + language := ctx.Values().GetString(langKey) if language == "" { // try to get by url parameter language = ctx.URLParam(i.config.URLParameter) @@ -50,6 +48,7 @@ func (i *i18nMiddleware) ServeHTTP(ctx context.Context) { if !wasByCookie { ctx.SetCookieKV(langKey, language) } + if language == "" { language = i.config.Default } diff --git a/sessions/sessiondb/boltdb/database.go b/sessions/sessiondb/boltdb/database.go index 7a27d5cc..b1b2bb64 100644 --- a/sessions/sessiondb/boltdb/database.go +++ b/sessions/sessiondb/boltdb/database.go @@ -174,7 +174,8 @@ func (db *Database) Acquire(sid string, expires time.Duration) (lifetime session return err } - if err := b.Put(expirationKey, timeBytes); err == nil { + err = b.Put(expirationKey, timeBytes) + if err == nil { // create the session bucket now, so the rest of the calls can be easly get the bucket without any further checks. _, err = root.CreateBucket(bsid) } @@ -366,11 +367,7 @@ func (db *Database) Release(sid string) { // try to delete the associated expiration bucket, if exists, ignore error. b.DeleteBucket(getExpirationBucketName(bsid)) - if err := b.DeleteBucket(bsid); err != nil { - return err - } - - return nil + return b.DeleteBucket(bsid) }) } diff --git a/sessions/sessiondb/redis/service/service.go b/sessions/sessiondb/redis/service/service.go index dbe58fc7..6d9c9007 100644 --- a/sessions/sessiondb/redis/service/service.go +++ b/sessions/sessiondb/redis/service/service.go @@ -3,6 +3,7 @@ package service import ( "fmt" "time" + "github.com/gomodule/redigo/redis" "github.com/kataras/iris/core/errors" ) @@ -94,7 +95,7 @@ func (r *Service) TTL(key string) (seconds int64, hasExpiration bool, found bool // if -1 means the key has unlimited life time. hasExpiration = seconds > -1 // if -2 means key does not exist. - found = ! (c.Err() != nil || seconds == -2) + found = !(c.Err() != nil || seconds == -2) return }