fix: use errors.Is for robust file-not-found check

This commit is contained in:
you
2026-04-05 21:47:04 +00:00
parent 594aff7cf0
commit 0c9fd6231e
+2 -1
View File
@@ -2,6 +2,7 @@ package main
import (
"encoding/json"
"errors"
"fmt"
"log"
"os"
@@ -86,7 +87,7 @@ func LoadConfig(path string) (*Config, error) {
data, err := os.ReadFile(path)
if err != nil {
if !os.IsNotExist(err) {
if !errors.Is(err, os.ErrNotExist) {
return nil, fmt.Errorf("reading config %s: %w", path, err)
}
// Config file doesn't exist — use defaults (zero-config mode)