1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-26 15:42:21 +08:00

config test: write local file

This commit is contained in:
Juan Batiz-Benet
2014-07-31 03:22:03 -07:00
parent b12134cd4c
commit dd08e0ed62
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -7,7 +7,7 @@ import (
func TestConfig(t *testing.T) {
cfg, err := Load("")
cfg, err := Load(".ipfsconfig")
if err != nil {
t.Error(err)
return