aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-02-26 09:41:54 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-02-26 09:41:54 +0100
commit09c5d54005e5876f400cee6349b79609311bde57 (patch)
tree045cae34cac3b9060ee07c1c60205378e50b458d
parent2ee60dbeaa032df6bfe9e50e6b57f1d68c71ae13 (diff)
Cleanup
-rw-r--r--cmd/acme/config.go9
-rw-r--r--cmd/acme/main.go2
2 files changed, 4 insertions, 7 deletions
diff --git a/cmd/acme/config.go b/cmd/acme/config.go
index 7421229..55cc13f 100644
--- a/cmd/acme/config.go
+++ b/cmd/acme/config.go
@@ -2,7 +2,6 @@ package main
import (
"errors"
- "fmt"
"io/ioutil"
"os/user"
"path"
@@ -10,7 +9,6 @@ import (
"time"
"dim13.org/acme"
-
"gopkg.in/yaml.v2"
)
@@ -60,13 +58,12 @@ var (
errNoMail = errors.New("no mail specified")
)
-func Dump(c *Config) error {
+func Dump(c *Config) (string, error) {
out, err := yaml.Marshal(c)
if err != nil {
- return err
+ return "", err
}
- fmt.Println(string(out))
- return nil
+ return string(out), nil
}
func LoadConfig(fname string) (*Config, error) {
diff --git a/cmd/acme/main.go b/cmd/acme/main.go
index 1ef42b9..c5d187c 100644
--- a/cmd/acme/main.go
+++ b/cmd/acme/main.go
@@ -74,7 +74,7 @@ func main() {
log.Fatal(err)
}
fmt.Printf("%+v\n", conf)
- Dump(conf)
+ fmt.Println(Dump(conf))
return
/*