summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2020-04-26 13:17:24 +0200
committerJan Dittberner <jandd@cacert.org>2020-04-26 13:17:24 +0200
commite6fb26e5effd345f527df0f267fbc7d5ba5f2184 (patch)
tree4e076c10f0ea1bcee9bceff4303888c54e92f9cb
parentb0aa52fc24561b18a2f9295cea027c9f874ae994 (diff)
downloadcacert-boardvoting-e6fb26e5effd345f527df0f267fbc7d5ba5f2184.tar.gz
cacert-boardvoting-e6fb26e5effd345f527df0f267fbc7d5ba5f2184.tar.xz
cacert-boardvoting-e6fb26e5effd345f527df0f267fbc7d5ba5f2184.zip
Fix Goland warnings caused by large assets.go
-rw-r--r--boardvoting.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/boardvoting.go b/boardvoting.go
index e58bee1..203bb3f 100644
--- a/boardvoting.go
+++ b/boardvoting.go
@@ -1,5 +1,5 @@
/*
- Copyright 2017-2019 Jan Dittberner
+ Copyright 2017-2020 Jan Dittberner
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this program except in compliance with the License.
@@ -65,7 +65,10 @@ func renderTemplate(w http.ResponseWriter, r *http.Request, templates []string,
var baseTemplate *template.Template
for count, t := range templates {
- if assetBytes, err := boardvoting.Asset(fmt.Sprintf("templates/%s", t)); err != nil {
+ var err error
+ var assetBytes []byte
+ if //noinspection GoUnresolvedReference
+ assetBytes, err = boardvoting.Asset(fmt.Sprintf("templates/%s", t)); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
} else {
if count == 0 {