chore: upgrade to go1.24

This commit is contained in:
Solomon Victorino
2025-04-05 15:11:51 -06:00
committed by ngn
parent 50784a6ab5
commit 0474c2dcb6
5 changed files with 23 additions and 11 deletions

View File

@ -18,15 +18,27 @@ func NewLogger(w io.WriteCloser) *Logger {
return &Logger{slog: sl}
}
func (l *Logger) Error(f string, args ...any) {
func (l *Logger) Errorf(f string, args ...any) {
l.slog.Error(fmt.Sprintf(f, args...))
}
func (l *Logger) Info(f string, args ...any) {
func (l *Logger) Error(e string) {
l.Errorf("%s", e)
}
func (l *Logger) Infof(f string, args ...any) {
l.slog.Info(fmt.Sprintf(f, args...))
}
func (l *Logger) Fatal(f string, args ...any) {
l.Error(f, args...)
func (l *Logger) Info(m string) {
l.Infof("%s", m)
}
func (l *Logger) Fatalf(f string, args ...any) {
l.Errorf(f, args...)
os.Exit(1)
}
func (l *Logger) Fatal(e string) {
l.Fatalf("%s", e)
}

View File

@ -9,7 +9,7 @@ import (
func RenderTemplate(w http.ResponseWriter, t templ.Component, l *Logger) {
if err := t.Render(context.Background(), w); err != nil {
l.Error("unable to render template %s", err)
l.Errorf("unable to render template %s", err)
w.WriteHeader(http.StatusInternalServerError)
_, err := w.Write([]byte{})
if err != nil {