mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-04 08:40:28 +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"
|
"bytes"
|
||||||
"image/png"
|
"image/png"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/hay-kot/homebox/backend/internal/sys/validate"
|
"github.com/hay-kot/homebox/backend/internal/sys/validate"
|
||||||
|
@ -55,7 +54,7 @@ func (ctrl *V1Controller) HandleGenerateQRCode() server.HandlerFunc {
|
||||||
io.Closer
|
io.Closer
|
||||||
}{
|
}{
|
||||||
Writer: w,
|
Writer: w,
|
||||||
Closer: ioutil.NopCloser(nil),
|
Closer: io.NopCloser(nil),
|
||||||
}
|
}
|
||||||
|
|
||||||
qrwriter := standard.NewWithWriter(toWriteCloser, standard.WithLogoImage(image))
|
qrwriter := standard.NewWithWriter(toWriteCloser, standard.WithLogoImage(image))
|
||||||
|
|
|
@ -2,7 +2,6 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
)
|
)
|
||||||
|
@ -31,7 +30,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
text := "/* post-processed by ./scripts/process-types.go */\n"
|
text := "/* post-processed by ./scripts/process-types.go */\n"
|
||||||
data, err := ioutil.ReadFile(path)
|
data, err := os.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -63,7 +62,7 @@ func main() {
|
||||||
text = regex.ReplaceAllString(text, replace)
|
text = regex.ReplaceAllString(text, replace)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ioutil.WriteFile(path, []byte(text), 0644)
|
err = os.WriteFile(path, []byte(text), 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue