From 53c9fb2f72cbc82177404b76a4aad14283f8ced1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 12 May 2024 21:29:22 +0200 Subject: fix: don't panic on TOML decode error --- internal/config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/config/config.go') diff --git a/internal/config/config.go b/internal/config/config.go index ff21a54..55f5efa 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -109,7 +109,7 @@ func GetConfig(filename string) (*Config, error) { dec := toml.NewDecoder(f) err = dec.Decode(&config) if err != nil { - var tomlError toml.DecodeError + var tomlError *toml.DecodeError if errors.As(err, &tomlError) { return nil, errors.WithMessage(err, tomlError.Error()) } -- cgit 1.4.1