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
dd08e0ed
Commit
dd08e0ed
authored
Jul 31, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config test: write local file
parent
b12134cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
config/config.go
config/config.go
+3
-1
config/config_test.go
config/config_test.go
+1
-1
No files found.
config/config.go
View file @
dd08e0ed
...
...
@@ -51,7 +51,9 @@ func Load(filename string) (*Config, error) {
// if nothing is there, write first config file.
if
_
,
err
:=
os
.
Stat
(
filename
);
os
.
IsNotExist
(
err
)
{
WriteFile
(
filename
,
[]
byte
(
defaultConfigFile
))
if
err
:=
WriteFile
(
filename
,
[]
byte
(
defaultConfigFile
));
err
!=
nil
{
return
nil
,
err
}
}
var
cfg
Config
...
...
config/config_test.go
View file @
dd08e0ed
...
...
@@ -7,7 +7,7 @@ import (
func
TestConfig
(
t
*
testing
.
T
)
{
cfg
,
err
:=
Load
(
""
)
cfg
,
err
:=
Load
(
"
.ipfsconfig
"
)
if
err
!=
nil
{
t
.
Error
(
err
)
return
...
...
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