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:
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/gochan.example.json ${RELEASE_DIR}/sample-configs/
|
||||
make build
|
||||
strip ${BINEXE}
|
||||
-strip ${BINEXE}
|
||||
make sass-minified
|
||||
mv ${BINEXE} ${RELEASE_DIR}/
|
||||
ifeq (${GCOS_NAME},macos)
|
||||
|
|
|
@ -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":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue