Introduced templating and views

This commit is contained in:
Simon Martens
2025-02-09 14:51:04 +01:00
parent 159fa1a7bb
commit a250d1b18e
209 changed files with 74559 additions and 0 deletions

43
helpers/errors.go Normal file
View File

@@ -0,0 +1,43 @@
package helpers
import (
"os"
"github.com/Theodor-Springmann-Stiftung/kgpz_web/helpers/logging"
)
func Assert(err error, msg ...string) {
if err == nil {
return
}
logging.Error(err, msg...)
os.Exit(1)
}
func AssertNonNil(obj interface{}, msg ...string) {
if obj != nil {
return
}
logging.Error(nil, msg...)
os.Exit(1)
}
func AssertNil(obj interface{}, msg ...string) {
if obj == nil {
return
}
logging.Error(nil, msg...)
os.Exit(1)
}
func AssertStr(str string, msg ...string) {
if str != "" {
return
}
logging.Error(nil, msg...)
os.Exit(1)
}