From 5820356cf68fb7e87422133eb95dff57a8fb2c4c Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sat, 10 Feb 2018 20:21:16 -0700 Subject: [PATCH] diagnostics: Persist UUID in string format for convenience --- caddy/caddymain/run.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/caddy/caddymain/run.go b/caddy/caddymain/run.go index c856d54e..9f26e02f 100644 --- a/caddy/caddymain/run.go +++ b/caddy/caddymain/run.go @@ -296,7 +296,7 @@ func initDiagnostics() { newUUID := func() uuid.UUID { id := uuid.New() - err := ioutil.WriteFile(uuidFilename, id[:], 0644) + err := ioutil.WriteFile(uuidFilename, []byte(id.String()), 0644) // human-readable this way if err != nil { log.Printf("[ERROR] Persisting instance UUID: %v", err) } @@ -319,7 +319,7 @@ func initDiagnostics() { log.Printf("[ERROR] Reading persistent UUID: %v", err) id = newUUID() } else { - id, err = uuid.FromBytes(uuidBytes) + id, err = uuid.ParseBytes(uuidBytes) if err != nil { log.Printf("[ERROR] Parsing UUID: %v", err) id = newUUID()