mirror of
https://github.com/fatedier/frp.git
synced 2025-07-27 07:35:07 +00:00
refactor: move from io/ioutil to io and os package (#2592)
This commit is contained in:
@@ -17,7 +17,6 @@ package config
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
@@ -77,7 +76,7 @@ func getIncludeContents(paths []string) ([]byte, error) {
|
||||
if _, err := os.Stat(absDir); os.IsNotExist(err) {
|
||||
return nil, err
|
||||
}
|
||||
files, err := ioutil.ReadDir(absDir)
|
||||
files, err := os.ReadDir(absDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@@ -16,7 +16,6 @@ package config
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"text/template"
|
||||
@@ -67,7 +66,7 @@ func RenderContent(in []byte) (out []byte, err error) {
|
||||
|
||||
func GetRenderedConfFromFile(path string) (out []byte, err error) {
|
||||
var b []byte
|
||||
b, err = ioutil.ReadFile(path)
|
||||
b, err = os.ReadFile(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user