Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
b54c7de4
Commit
b54c7de4
authored
Jan 12, 2015
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(fsrepo): add guard to ConfigKey methods
parent
3986af76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
repo/fsrepo/fsrepo.go
repo/fsrepo/fsrepo.go
+6
-0
No files found.
repo/fsrepo/fsrepo.go
View file @
b54c7de4
...
...
@@ -110,6 +110,9 @@ func (r *FSRepo) SetConfig(conf *config.Config) error {
// GetConfigKey retrieves only the value of a particular key
func
(
r
*
FSRepo
)
GetConfigKey
(
key
string
)
(
interface
{},
error
)
{
if
r
.
state
!=
opened
{
return
nil
,
debugerror
.
Errorf
(
"repo is %s"
,
r
.
state
)
}
filename
,
err
:=
config
.
Filename
(
r
.
path
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -123,6 +126,9 @@ func (r *FSRepo) GetConfigKey(key string) (interface{}, error) {
// SetConfigKey writes the value of a particular key
func
(
r
*
FSRepo
)
SetConfigKey
(
key
string
,
value
interface
{})
error
{
if
r
.
state
!=
opened
{
return
debugerror
.
Errorf
(
"repo is %s"
,
r
.
state
)
}
filename
,
err
:=
config
.
Filename
(
r
.
path
)
if
err
!=
nil
{
return
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment