1
0
Fork 0
mirror of https://github.com/Luzifer/gen-dockerfile.git synced 2024-12-20 10:41:18 +00:00

Lint: replace deprecated function calls

This commit is contained in:
Knut Ahlers 2024-11-22 13:53:25 +01:00
parent 37f4c44dff
commit d6f669638d
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E

View file

@ -4,7 +4,6 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"os" "os"
"os/exec" "os/exec"
"regexp" "regexp"
@ -107,7 +106,7 @@ func main() {
var output io.Writer = os.Stdout var output io.Writer = os.Stdout
if cfg.Diff { if cfg.Diff {
displayDiff(buf) displayDiff(buf)
output = ioutil.Discard output = io.Discard
} }
if cfg.Write { if cfg.Write {
@ -130,7 +129,7 @@ func displayDiff(buf *bytes.Buffer) {
) )
if _, err := os.Stat("Dockerfile"); err == nil { if _, err := os.Stat("Dockerfile"); err == nil {
oldDockerfile, err = ioutil.ReadFile("Dockerfile") oldDockerfile, err = os.ReadFile("Dockerfile")
if err != nil { if err != nil {
log.WithError(err).Fatal("Could not read existing Dockerfile") log.WithError(err).Fatal("Could not read existing Dockerfile")
} }