Skip to content

Commit

Permalink
Get rid of deprecated ioutil invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofranssen committed Oct 12, 2021
1 parent 152e54e commit cca7a22
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/slsa-provenance/cli/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"flag"
"fmt"
"io/fs"
"io/ioutil"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -49,7 +48,7 @@ func subjects(root string) ([]provenance.Subject, error) {
if relpath == "." {
relpath = filepath.Base(root)
}
contents, err := ioutil.ReadFile(abspath)
contents, err := os.ReadFile(abspath)
if err != nil {
return err
}
Expand Down Expand Up @@ -155,7 +154,7 @@ func Generate() *ffcli.Command {
// Envelope to support attaching signatures.
payload, _ := json.MarshalIndent(stmt, "", " ")
fmt.Println("Provenance:\n" + string(payload))
if err := ioutil.WriteFile(*outputPath, payload, 0755); err != nil {
if err := os.WriteFile(*outputPath, payload, 0755); err != nil {
return errors.Wrap(err, "failed to write provenance")
}

Expand Down

0 comments on commit cca7a22

Please sign in to comment.