mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-10-26 09:11:01 +00:00
refactor
This commit is contained in:
@@ -4,13 +4,11 @@ import (
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func LoadTemplate(template string) ([]byte, error) {
|
||||
tPath := filepath.Join("templates", template)
|
||||
if _, err := os.Stat(tPath); err == nil {
|
||||
file, err := os.Open(tPath)
|
||||
func LoadTemplate(templatePath string) ([]byte, error) {
|
||||
if _, err := os.Stat(templatePath); err == nil {
|
||||
file, err := os.Open(templatePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user