summary refs log tree commit diff stats
path: root/svc/cache.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-09 04:21:03 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-09 04:21:03 -0400
commitc0507308950bf7db65d1f6ee79ce9f67b61cbe0e (patch)
tree09184268fa8872fe403398142fbce2b78cab9907 /svc/cache.go
parent7410b8cd74d0f702b087577b1793bcf541ac8371 (diff)
downloadgetwtxt-c0507308950bf7db65d1f6ee79ce9f67b61cbe0e.tar.gz
explicit init of static assets and test template init were removed: redundant
Diffstat (limited to 'svc/cache.go')
-rw-r--r--svc/cache.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/svc/cache.go b/svc/cache.go
index e2078d7..20c3953 100644
--- a/svc/cache.go
+++ b/svc/cache.go
@@ -33,33 +33,6 @@ func initTemplates() *template.Template {
 	return template.Must(template.ParseFiles(assetsDir + "/tmpl/index.html"))
 }
 
-func initAssets() *staticAssets {
-	confObj.Mu.RLock()
-	defer confObj.Mu.RUnlock()
-
-	css, err := os.Open(confObj.AssetsDir + "/style.css")
-	errLog("", err)
-	cssStat, err := css.Stat()
-	errLog("", err)
-	cssData, err := ioutil.ReadAll(css)
-	errLog("", err)
-
-	indStat, err := os.Stat(confObj.AssetsDir + "/tmpl/index.html")
-	errLog("", err)
-
-	var b []byte
-	buf := bytes.NewBuffer(b)
-	errLog("", tmpls.ExecuteTemplate(buf, "index.html", confObj.Instance))
-
-	return &staticAssets{
-		mu:       sync.RWMutex{},
-		index:    buf.Bytes(),
-		indexMod: indStat.ModTime(),
-		css:      cssData,
-		cssMod:   cssStat.ModTime(),
-	}
-}
-
 func cacheTimer() bool {
 	confObj.Mu.RLock()
 	answer := time.Since(confObj.LastCache) > confObj.CacheInterval