diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-06-19 14:53:01 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2024-06-25 12:41:13 +0000 |
| commit | 8f95d2d8ec2ae7143fe95c59f7f406e0bd1656dc (patch) | |
| tree | ee1987310037ee17d90a543006cc396c56cefa0b /internal/config/config.go | |
| parent | 5a06e4f2755e1265f34acc3fb9d819a7a22b7cd0 (diff) | |
Config: Atomic file writes using tailscale package
Diffstat (limited to 'internal/config/config.go')
| -rw-r--r-- | internal/config/config.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index ed424f8..04132ee 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -7,6 +7,7 @@ import ( "os" "path" + "github.com/eduvpn/eduvpn-common/internal/config/atomicfile" "github.com/eduvpn/eduvpn-common/internal/config/v1" "github.com/eduvpn/eduvpn-common/internal/config/v2" "github.com/eduvpn/eduvpn-common/internal/discovery" @@ -43,7 +44,7 @@ func (c *Config) Save() error { if err != nil { return err } - if err = os.WriteFile(c.filename(), cfg, 0o600); err != nil { + if err = atomicfile.WriteFile(c.filename(), cfg, 0o600); err != nil { return err } return nil |
