Comments (3)
connString := "root:12344321@/giligili?charset=utf8&parseTime=True&loc=Local"
//connString := "root:12344321@/giligili?charset=utf8&parseTime=True&loc=Local"
dbConnectString := os.Getenv("MYSQL_DSN")
fmt.Println("dbConnectString:", dbConnectString)
model.Database(connString)
如果直接用connString 在model.Database(connString) ,就不会报错
如果从环境中获取,就会报错,我打印了环境变量中的os.Getenv("MYSQL_DSN") 和connString,是一摸一样的,但是用环境变量的就是不行
from giligili.
你的说法很奇怪,似乎在说os.Getenv得到的string和直接的string,两个string不是===似的
from giligili.
go run main.go 运行时出现 panic: unknown time zone Local",是我哪里配置有问题吗
错误信息是指 unknown time zone Local"
(末尾多了个 "
)
这个问题可能是由于环境变量设置的时候有问题,比如以下面这种方式设置:
MYSQL_DSN="root:12344321@/giligili?charset=utf8&parseTime=True&loc=Local\""
末尾多了一个 "
.
from giligili.
Related Issues (15)
- 阿里云docker编译失败
- 咋群都没了啊大佬
- redis版本不能work HOT 1
- 啥时候加视频评论功能 HOT 1
- 视频是引用外链的吗?还是存服务器上的
- panic: dial tcp: lookup tcp/port: Servname not supported for ai_socktype
- www.gourouting.com访问不了 HOT 3
- daily rank无数据 HOT 1
- swagger目录是怎么初始化和更新? HOT 1
- go mod都官方支持了 HOT 1
- 这个是不是没有绑定video和作者id
- CreateVideo 视频投稿 HOT 1
- 是时候更新一下readme了 HOT 2
- please update this HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from giligili.