Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b97d9896
authored
2013-12-09 23:54:35 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update config to change section . to ::
1 parent
690ecb81
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
config/ini.go
config/ini_test.go
config/ini.go
View file @
b97d989
...
...
@@ -154,7 +154,7 @@ func (c *IniConfigContainer) Set(key, value string) error {
var
section
,
k
string
key
=
strings
.
ToLower
(
key
)
sectionkey
:=
strings
.
Split
(
key
,
"
.
"
)
sectionkey
:=
strings
.
Split
(
key
,
"
::
"
)
if
len
(
sectionkey
)
>=
2
{
section
=
sectionkey
[
0
]
k
=
sectionkey
[
1
]
...
...
@@ -184,7 +184,7 @@ func (c *IniConfigContainer) getdata(key string) string {
var
section
,
k
string
key
=
strings
.
ToLower
(
key
)
sectionkey
:=
strings
.
Split
(
key
,
"
.
"
)
sectionkey
:=
strings
.
Split
(
key
,
"
::
"
)
if
len
(
sectionkey
)
>=
2
{
section
=
sectionkey
[
0
]
k
=
sectionkey
[
1
]
...
...
config/ini_test.go
View file @
b97d989
...
...
@@ -69,13 +69,13 @@ func TestIni(t *testing.T) {
if
iniconf
.
String
(
"name"
)
!=
"astaxie"
{
t
.
Fatal
(
"get name error"
)
}
if
iniconf
.
String
(
"demo
.
key1"
)
!=
"asta"
{
if
iniconf
.
String
(
"demo
::
key1"
)
!=
"asta"
{
t
.
Fatal
(
"get demo.key1 error"
)
}
if
iniconf
.
String
(
"demo
.
key2"
)
!=
"xie"
{
if
iniconf
.
String
(
"demo
::
key2"
)
!=
"xie"
{
t
.
Fatal
(
"get demo.key2 error"
)
}
if
v
,
err
:=
iniconf
.
Bool
(
"demo
.
caseinsensitive"
);
err
!=
nil
||
v
!=
true
{
if
v
,
err
:=
iniconf
.
Bool
(
"demo
::
caseinsensitive"
);
err
!=
nil
||
v
!=
true
{
t
.
Fatal
(
"get demo.caseinsensitive error"
)
}
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment