1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-03 07:36:23 -07:00

Remove unnecessary template functions

Also don't fail if strip fails (for example if it's an incompatible binary format)
Also also use proper switch fallthrough
This commit is contained in:
Eggbertx 2020-03-30 09:14:43 -07:00
parent 0bcd93379b
commit cf7cfa9d4b
2 changed files with 6 additions and 9 deletions

View file

@ -97,7 +97,7 @@ release:
cp sample-configs/*.nginx ${RELEASE_DIR}/sample-configs/
cp sample-configs/gochan.example.json ${RELEASE_DIR}/sample-configs/
make build
strip ${BINEXE}
-strip ${BINEXE}
make sass-minified
mv ${BINEXE} ${RELEASE_DIR}/
ifeq (${GCOS_NAME},macos)

View file

@ -74,14 +74,6 @@ var funcMap = template.FuncMap{
return fmt.Sprintf("%0.2f GB", size/1024/1024/1024)
},
"formatTimestamp": humanReadableTime,
"errorf": func(format string, a ...interface{}) string {
gclog.Printf(lErrorLog, format, a...)
return ""
},
"print": func(v int, i ...interface{}) string {
gclog.Print(lErrorLog, i...)
return ""
},
"stringAppend": func(strings ...string) string {
var appended string
for _, str := range strings {
@ -184,10 +176,15 @@ var funcMap = template.FuncMap{
var uploadType string
switch extension {
case "":
fallthrough
case "deleted":
uploadType = ""
case "webm":
fallthrough
case "jpg":
fallthrough
case "jpeg":
fallthrough
case "gif":
uploadType = "jpg"
case "png":