@@ -18,8 +18,8 @@ import (
18
18
"context"
19
19
"fmt"
20
20
"io"
21
- "io/ioutil"
22
21
"net/http"
22
+ "os"
23
23
"path/filepath"
24
24
"time"
25
25
@@ -59,7 +59,7 @@ type ReaderResource struct {
59
59
// Load will load the resource into byte array.
60
60
func (res * ReaderResource ) Load () ([]byte , error ) {
61
61
62
- return ioutil .ReadAll (res .Reader )
62
+ return io .ReadAll (res .Reader )
63
63
}
64
64
65
65
// String will state the resource source.
@@ -124,7 +124,7 @@ func (bundle *FileResourceBundle) MustLoad() []Resource {
124
124
func (bundle * FileResourceBundle ) loadPath (path string ) ([]Resource , error ) {
125
125
logger .Log .Tracef ("Enter directory %s" , path )
126
126
127
- finfos , err := ioutil .ReadDir (path )
127
+ finfos , err := os .ReadDir (path )
128
128
129
129
if err != nil {
130
130
@@ -148,7 +148,7 @@ func (bundle *FileResourceBundle) loadPath(path string) ([]Resource, error) {
148
148
}
149
149
if matched {
150
150
logger .Log .Debugf ("Loading file %s" , fulPath )
151
- bytes , err := ioutil .ReadFile (fulPath )
151
+ bytes , err := os .ReadFile (fulPath )
152
152
if err != nil {
153
153
return nil , err
154
154
}
@@ -182,7 +182,7 @@ func (res *FileResource) Load() ([]byte, error) {
182
182
183
183
return res .Bytes , nil
184
184
}
185
- data , err := ioutil .ReadFile (res .Path )
185
+ data , err := os .ReadFile (res .Path )
186
186
if err != nil {
187
187
188
188
return nil , err
@@ -280,7 +280,7 @@ func (res *URLResource) Load() ([]byte, error) {
280
280
return nil , err
281
281
}
282
282
defer resp .Body .Close ()
283
- data , err := ioutil .ReadAll (resp .Body )
283
+ data , err := io .ReadAll (resp .Body )
284
284
if err != nil {
285
285
286
286
return nil , err
@@ -360,7 +360,7 @@ func (bundle *GITResourceBundle) loadPath(url, path string, fileSyst billy.Files
360
360
361
361
return nil , err
362
362
}
363
- bytes , err := ioutil .ReadAll (f )
363
+ bytes , err := io .ReadAll (f )
364
364
if err != nil {
365
365
366
366
return nil , err
0 commit comments