run go fmt on config file
This commit is contained in:
1 parent
e07086a523
commit
90063e1431
1 file changed
+9
-8
@@ -1,12 +1,13 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/btcsuite/btcd/chaincfg"
|
||||||
"github.com/btcsuite/btcutil"
|
"github.com/btcsuite/btcutil"
|
||||||
flags "github.com/btcsuite/go-flags"
|
flags "github.com/btcsuite/go-flags"
|
||||||
"path/filepath"
|
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -81,21 +82,21 @@ func loadConfig() (*config, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
_, err = flags.Parse(&cfg)
|
_, err = flags.Parse(&cfg)
|
||||||
// Determine net parameters
|
// Determine net parameters
|
||||||
if cfg.UseRegtest {
|
if cfg.UseRegtest {
|
||||||
cfg.NetParams = &chaincfg.RegressionNetParams
|
cfg.NetParams = &chaincfg.RegressionNetParams
|
||||||
} else {
|
} else {
|
||||||
cfg.NetParams = &chaincfg.TestNet3Params
|
cfg.NetParams = &chaincfg.TestNet3Params
|
||||||
}
|
}
|
||||||
// Read certificate if needed
|
// Read certificate if needed
|
||||||
if cfg.BTCDCACertPath!=""{
|
if cfg.BTCDCACertPath != "" {
|
||||||
f, err := os.Open(cfg.BTCDCACertPath)
|
f, err := os.Open(cfg.BTCDCACertPath)
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
if err!=nil{
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
cert, err := ioutil.ReadAll(f)
|
cert, err := ioutil.ReadAll(f)
|
||||||
if err!=nil{
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
cfg.BTCDCACert = cert
|
cfg.BTCDCACert = cert
|
||||||
|
|||||||
Reference in new issue
Block a user