关于beego session redis报错的问题

栏目: Go · 发布时间: 6年前

内容简介:提示错误在import  中添加 Redis
func main(){
   sessionConfig := &session.ManagerConfig{
		CookieName :"gocsessionid",
		EnableSetCookie : true,
		Gclifetime : 3600,
		Maxlifetime : 3600,
		Secure : false,
		CookieLifeTime : 3600,
		ProviderConfig :"127.0.0.1:6379,root",
	}
	gloabalSessions, _ = session.NewManager("redis",sessionConfig)
	go gloabalSessions.GC()
}

提示错误

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x13b32a6]

goroutine 6 [running]:
github.com/astaxie/beego/session.(*Manager).GC(0x0)

在import  中添加 Redis

import(_"github.com/astaxie/beego/session/redis")

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Inside Larry's and Sergey's Brain

Inside Larry's and Sergey's Brain

Richard Brandt / Portfolio / 17 Sep 2009 / USD 24.95

You’ve used their products. You’ve heard about their skyrocketing wealth and “don’t be evil” business motto. But how much do you really know about Google’s founders, Larry Page and Sergey Brin? Inside......一起来看看 《Inside Larry's and Sergey's Brain》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具