Move from deprecated ioutil to os and io packages (#4364)

This commit is contained in:
KallyDev 2021-09-30 01:17:48 +08:00 committed by GitHub
parent 059fc32f00
commit c48fadc4a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 71 additions and 84 deletions

View file

@ -17,7 +17,7 @@ package caddyfile
import (
"bytes"
"fmt"
"io/ioutil"
"io"
"log"
"os"
"path/filepath"
@ -447,7 +447,7 @@ func (p *parser) doSingleImport(importFile string) ([]Token, error) {
return nil, p.Errf("Could not import %s: is a directory", importFile)
}
input, err := ioutil.ReadAll(file)
input, err := io.ReadAll(file)
if err != nil {
return nil, p.Errf("Could not read imported file %s: %v", importFile, err)
}