mirror of
https://github.com/Baipyrus/ProxySwitcher.git
synced 2024-12-26 04:31:45 +00:00
ignore example files in configurations
This commit is contained in:
parent
4c11cb4fb2
commit
4340ca271d
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user