diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-02-28 11:24:17 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-02-28 11:24:17 +0100 |
| commit | 0cef468252e25f409a435fa0da95ae7faf4698c1 (patch) | |
| tree | a14fbb2b536e907d5f850a1595783676c479f6da /internal/config/config.go | |
| parent | 8821fd18406a9b8a881e673796020abf329031c5 (diff) | |
Config: Rename ConfigFormat to Format
Diffstat (limited to 'internal/config/config.go')
| -rw-r--r-- | internal/config/config.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 239e456..3590285 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -20,7 +20,7 @@ type Config struct { Name string } -type ConfigFormat struct { +type Format struct { Data interface{} `json:"v1"` } @@ -41,7 +41,7 @@ func (c *Config) Save(readStruct interface{}) error { if err := util.EnsureDirectory(c.Directory); err != nil { return err } - cf := &ConfigFormat{Data: readStruct} + cf := &Format{Data: readStruct} cfg, err := json.Marshal(cf) if err != nil { return errors.WrapPrefix(err, "json.Marshal failed", 0) @@ -59,7 +59,7 @@ func (c *Config) Load(writeStruct interface{}) error { if err != nil { return errors.WrapPrefix(err, "failed loading configuration", 0) } - cf := ConfigFormat{Data: writeStruct} + cf := Format{Data: writeStruct} if err = json.Unmarshal(bts, &cf); err != nil { return errors.WrapPrefix(err, "json.Unmarshal failed", 0) } |
