mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-05 08:46: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:
parent
0bcd93379b
commit
cf7cfa9d4b
2 changed files with 6 additions and 9 deletions
2
Makefile
2
Makefile
|
@ -97,7 +97,7 @@ release:
|
||||||
cp sample-configs/*.nginx ${RELEASE_DIR}/sample-configs/
|
cp sample-configs/*.nginx ${RELEASE_DIR}/sample-configs/
|
||||||
cp sample-configs/gochan.example.json ${RELEASE_DIR}/sample-configs/
|
cp sample-configs/gochan.example.json ${RELEASE_DIR}/sample-configs/
|
||||||
make build
|
make build
|
||||||
strip ${BINEXE}
|
-strip ${BINEXE}
|
||||||
make sass-minified
|
make sass-minified
|
||||||
mv ${BINEXE} ${RELEASE_DIR}/
|
mv ${BINEXE} ${RELEASE_DIR}/
|
||||||
ifeq (${GCOS_NAME},macos)
|
ifeq (${GCOS_NAME},macos)
|
||||||
|
|
|
@ -74,14 +74,6 @@ var funcMap = template.FuncMap{
|
||||||
return fmt.Sprintf("%0.2f GB", size/1024/1024/1024)
|
return fmt.Sprintf("%0.2f GB", size/1024/1024/1024)
|
||||||
},
|
},
|
||||||
"formatTimestamp": humanReadableTime,
|
"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 {
|
"stringAppend": func(strings ...string) string {
|
||||||
var appended string
|
var appended string
|
||||||
for _, str := range strings {
|
for _, str := range strings {
|
||||||
|
@ -184,10 +176,15 @@ var funcMap = template.FuncMap{
|
||||||
var uploadType string
|
var uploadType string
|
||||||
switch extension {
|
switch extension {
|
||||||
case "":
|
case "":
|
||||||
|
fallthrough
|
||||||
case "deleted":
|
case "deleted":
|
||||||
uploadType = ""
|
uploadType = ""
|
||||||
case "webm":
|
case "webm":
|
||||||
|
fallthrough
|
||||||
case "jpg":
|
case "jpg":
|
||||||
|
fallthrough
|
||||||
|
case "jpeg":
|
||||||
|
fallthrough
|
||||||
case "gif":
|
case "gif":
|
||||||
uploadType = "jpg"
|
uploadType = "jpg"
|
||||||
case "png":
|
case "png":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue