mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-04 00:30:27 +00:00
fix old API calls for ioutils
This commit is contained in:
parent
fcff5772e9
commit
ceedd225be
2 changed files with 3 additions and 5 deletions
|
@ -4,7 +4,6 @@ import (
|
|||
"bytes"
|
||||
"image/png"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
||||
"github.com/hay-kot/homebox/backend/internal/sys/validate"
|
||||
|
@ -55,7 +54,7 @@ func (ctrl *V1Controller) HandleGenerateQRCode() server.HandlerFunc {
|
|||
io.Closer
|
||||
}{
|
||||
Writer: w,
|
||||
Closer: ioutil.NopCloser(nil),
|
||||
Closer: io.NopCloser(nil),
|
||||
}
|
||||
|
||||
qrwriter := standard.NewWithWriter(toWriteCloser, standard.WithLogoImage(image))
|
||||
|
|
|
@ -2,7 +2,6 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"regexp"
|
||||
)
|
||||
|
@ -31,7 +30,7 @@ func main() {
|
|||
}
|
||||
|
||||
text := "/* post-processed by ./scripts/process-types.go */\n"
|
||||
data, err := ioutil.ReadFile(path)
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
@ -63,7 +62,7 @@ func main() {
|
|||
text = regex.ReplaceAllString(text, replace)
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile(path, []byte(text), 0644)
|
||||
err = os.WriteFile(path, []byte(text), 0644)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue