From 3e08824703812ee6ef1aa0c1c82e068ee68e2fbe Mon Sep 17 00:00:00 2001 From: Tino Date: Wed, 6 Dec 2017 21:15:29 +0100 Subject: [PATCH] Remove superfluous constructs of store --- route/no_route.go | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/route/no_route.go b/route/no_route.go index d16f80873..5273eb241 100644 --- a/route/no_route.go +++ b/route/no_route.go @@ -5,29 +5,21 @@ import ( "sync/atomic" ) -// HTML Wrapper struct so we can store the html string in an atomic.Value -type HTML struct { - value string -} - -// html stores the no route html string -var store atomic.Value +var store atomic.Value // string func init() { - store.Store(HTML{""}) + store.Store("") } -// GetHTML returns the HTML for not found routes. The function is safe to be -// called from multiple goroutines. +// GetHTML returns the HTML for not found routes. func GetHTML() string { - return store.Load().(HTML).value + return store.Load().(string) } -// SetHTML sets the current noroute html. The function is safe to be called from -// multiple goroutines. +// SetHTML sets the current noroute html. func SetHTML(h string) { - html := HTML{h} - store.Store(html) + // html := HTML{h} + store.Store(h) if h == "" { log.Print("[INFO] Unset noroute HTML")