Use log.Panic instead of panic.

master v0.2.0
Zed A. Shaw 1 month ago
parent 0df151c7e4
commit a3dce447f9
  1. 11
      main.go

@ -5,17 +5,18 @@ import (
_ "embed"
"flag"
"fmt"
"github.com/fsnotify/fsnotify"
"github.com/yuin/goldmark"
"io"
"io/fs"
"lcthw.dev/go/ssgod/config"
"log"
"os"
"path/filepath"
"strings"
"text/template"
"time"
"github.com/fsnotify/fsnotify"
"github.com/yuin/goldmark"
"lcthw.dev/go/ssgod/config"
)
//go:embed example/.ssgod.json
@ -33,12 +34,12 @@ func (meta *PageMetaData) AddPage(path string) {
func Fatal(err error, format string, v ...any) {
err_format := fmt.Sprintf("ERROR: %v; %s", err, format)
panic(fmt.Sprintf(err_format, v...))
log.Panicf(err_format, v...)
}
func Fail(err error, format string, v ...any) error {
err_format := fmt.Sprintf("ERROR: %v; %s", err, format)
panic(fmt.Sprintf(err_format, v...))
log.Panicf(err_format, v...)
return err
}

Loading…
Cancel
Save