ignore example files in configurations

This commit is contained in:
Baipyrus 2024-09-24 14:49:47 +02:00
parent 4c11cb4fb2
commit 4340ca271d

View File

@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"io/fs" "io/fs"
"path/filepath" "path/filepath"
"strings"
"io" "io"
"os" "os"
@ -13,7 +14,7 @@ func ReadConfigs(cfgPath string) ([]*Config, error) {
var configs []*Config var configs []*Config
err := filepath.Walk(cfgPath, func(path string, info fs.FileInfo, err error) error { err := filepath.Walk(cfgPath, func(path string, info fs.FileInfo, err error) error {
if info.IsDir() { if info.IsDir() || strings.HasSuffix(info.Name(), ".example.json") {
return nil return nil
} }