func Match(pattern string) ([]string, error) {
	if IsRemoteFile(pattern) {
		return []string{pattern}, nil
	}
	files, err := filepath.Glob(pattern)
	if err != nil {
		return nil, err
	}
	if files == nil {
		return nil, fmt.Errorf("%s: %w", pattern, fs.ErrNotExist)
	}
	var envFiles []string
	for _, f := range files {
		abs, err := filepath.Abs(f)
		if err != nil {
			return nil, err
		}
		envFiles = append(envFiles, abs)
	}
	sort.Strings(envFiles)
	return envFiles, nil
}
Match returns a sorted list of files and dirs matching a glob pattern
package filematcher
import (
	"fmt"
	"io/fs"
	"path/filepath"
	"sort"
	"strings"
)