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
d446b5b0
authored
2015-04-05 23:23:35 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
improve the defaultval
1 parent
2ba12ad1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
config.go
config.go
View file @
d446b5b
...
...
@@ -158,7 +158,7 @@ func (b *beegoAppConfig) DefaultString(key string, defaultval string) string {
if
v
!=
""
{
return
v
}
return
b
.
innerConfig
.
DefaultString
(
key
,
defaultval
)
return
defaultval
}
func
(
b
*
beegoAppConfig
)
DefaultStrings
(
key
string
,
defaultval
[]
string
)
[]
string
{
...
...
@@ -166,7 +166,7 @@ func (b *beegoAppConfig) DefaultStrings(key string, defaultval []string) []strin
if
len
(
v
)
!=
0
{
return
v
}
return
b
.
innerConfig
.
DefaultStrings
(
key
,
defaultval
)
return
defaultval
}
func
(
b
*
beegoAppConfig
)
DefaultInt
(
key
string
,
defaultval
int
)
int
{
...
...
@@ -174,7 +174,7 @@ func (b *beegoAppConfig) DefaultInt(key string, defaultval int) int {
if
err
==
nil
{
return
v
}
return
b
.
innerConfig
.
DefaultInt
(
key
,
defaultval
)
return
defaultval
}
func
(
b
*
beegoAppConfig
)
DefaultInt64
(
key
string
,
defaultval
int64
)
int64
{
...
...
@@ -182,7 +182,7 @@ func (b *beegoAppConfig) DefaultInt64(key string, defaultval int64) int64 {
if
err
==
nil
{
return
v
}
return
b
.
innerConfig
.
DefaultInt64
(
key
,
defaultval
)
return
defaultval
}
func
(
b
*
beegoAppConfig
)
DefaultBool
(
key
string
,
defaultval
bool
)
bool
{
...
...
@@ -190,7 +190,7 @@ func (b *beegoAppConfig) DefaultBool(key string, defaultval bool) bool {
if
err
==
nil
{
return
v
}
return
b
.
innerConfig
.
DefaultBool
(
key
,
defaultval
)
return
defaultval
}
func
(
b
*
beegoAppConfig
)
DefaultFloat
(
key
string
,
defaultval
float64
)
float64
{
...
...
@@ -198,7 +198,7 @@ func (b *beegoAppConfig) DefaultFloat(key string, defaultval float64) float64 {
if
err
==
nil
{
return
v
}
return
b
.
innerConfig
.
DefaultFloat
(
key
,
defaultval
)
return
defaultval
}
func
(
b
*
beegoAppConfig
)
DIY
(
key
string
)
(
interface
{},
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