Skip to content

Commit 018cf4a

Browse files
committed
util: s/Folder/Directory. Do GetDenylistFilesinDir()
1 parent 3ea0e8f commit 018cf4a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

util.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,34 @@ import (
99
)
1010

1111
// GetDenylistFiles returns a list of ".deny" files found in
12-
// $XDG_CONFIG_HOME/ipfs/denylists and /etc/ipfs/denylists. The files are
13-
// sortered by their names in their respective folders.
12+
// $XDG_CONFIG_HOME/ipfs/denylists and /etc/ipfs/denylists. The files are
13+
// sortered by their names in their respective directories.
1414
func GetDenylistFiles() ([]string, error) {
1515
// First, look for denylists in $XDG_CONFIG_HOME/ipfs/denylists
1616
xdgConfigHome := os.Getenv("XDG_CONFIG_HOME")
1717
if xdgConfigHome == "" {
1818
xdgConfigHome = os.Getenv("HOME") + "/.config"
1919
}
2020
ipfsDenylistPath := filepath.Join(xdgConfigHome, "ipfs", "denylists")
21-
ipfsDenylistFiles, err := GetDenylistFilesInFolder(ipfsDenylistPath)
21+
ipfsDenylistFiles, err := GetDenylistFilesInDir(ipfsDenylistPath)
2222
if err != nil {
2323
return nil, err
2424
}
2525

2626
// Then, look for denylists in /etc/ipfs/denylists
2727
etcDenylistPath := "/etc/ipfs/denylists"
28-
etcDenylistFiles, err := GetDenylistFilesInFolder(etcDenylistPath)
28+
etcDenylistFiles, err := GetDenylistFilesInDir(etcDenylistPath)
2929
if err != nil {
3030
return nil, err
3131
}
3232

3333
return append(ipfsDenylistFiles, etcDenylistFiles...), nil
3434
}
3535

36-
// GetDenylistFilesInFolder returns a list of ".deny" files found in the given
37-
// folder. The files are sortered by their names. It returns an empty list and
38-
// no error if the folder does not exist.
39-
func GetDenylistFilesInFolder(dirpath string) ([]string, error) {
36+
// GetDenylistFilesInDir returns a list of ".deny" files found in the given
37+
// directory. The files are sortered by their names. It returns an empty list
38+
// and no error if the directory does not exist.
39+
func GetDenylistFilesInDir(dirpath string) ([]string, error) {
4040
var denylistFiles []string
4141

4242
// WalkDir outputs files in lexical order.

0 commit comments

Comments
 (0)