1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-10 03:00:19 +00:00

Update config suport environment variable logic

This commit is contained in:
ysqi
2016-03-12 14:32:39 +08:00
parent 86c7f1db9e
commit b2a06c5fa0
10 changed files with 240 additions and 219 deletions

View File

@ -86,18 +86,25 @@ func TestJson(t *testing.T) {
"enableSession": "Y",
"enableCookie": "N",
"flag": 1,
"path": "$ENV_GOROOT",
"path1": "$$GOROOT",
"path2": "$$GOROOT||/home/go",
"path3": "$$GOROOT$$GOPATH2||/home/go",
"token1": "$$TOKEN",
"token2": "$$TOKEN||",
"token3": "$$TOKEN||astaxie",
"token4": "token$$TOKEN",
"token5": "$$TOKEN$$TOKEN||TOKEN",
"database": {
"host": "host",
"port": "port",
"database": "database",
"username": "username",
"password": "$ENV_GOROOT",
"password": "$$GOROOT",
"conns":{
"maxconnection":12,
"autoconnect":true,
"connectioninfo":"info",
"root": "$ENV_GOROOT"
"root": "$$GOROOT"
}
}
}`
@ -117,7 +124,14 @@ func TestJson(t *testing.T) {
"enableSession": true,
"enableCookie": false,
"flag": true,
"path": os.Getenv("GOROOT"),
"path1": os.Getenv("GOROOT"),
"path2": os.Getenv("GOROOT"),
"path3": "/home/go",
"token1": "",
"token2": "",
"token3": "astaxie",
"token4": "token$$TOKEN",
"token5": "TOKEN",
"database::host": "host",
"database::port": "port",
"database::database": "database",