replace deprecated ioutils
This commit is contained in:
parent
a14bc1b5ee
commit
5a891c8207
|
@ -8,9 +8,10 @@ package template
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/flowchartsman/handlebars/v3"
|
||||
|
@ -33,14 +34,14 @@ func Render(template string, payload interface{}) (s string, err error) {
|
|||
|
||||
defer res.Body.Close()
|
||||
|
||||
out, err := ioutil.ReadAll(res.Body)
|
||||
out, err := io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
return s, fmt.Errorf("failed to read: %w", err)
|
||||
}
|
||||
|
||||
template = string(out)
|
||||
case "file":
|
||||
out, err := ioutil.ReadFile(u.Path)
|
||||
out, err := os.ReadFile(u.Path)
|
||||
if err != nil {
|
||||
return s, fmt.Errorf("failed to read: %w", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue