chore: removing deprecated ioutil package

This commit is contained in:
Victor Fernandes 2023-11-16 17:06:08 +01:00
parent b7d7b4d0dc
commit fcfe30804a
No known key found for this signature in database
GPG key ID: ACDB2332EA5A89A6
4 changed files with 11 additions and 11 deletions

6
pkg/cache/ondisk.go vendored
View file

@ -4,7 +4,7 @@ import (
"crypto/sha256"
"encoding/hex"
"fmt"
"io/ioutil"
"io"
"os"
"path"
"sync"
@ -37,12 +37,12 @@ func (c *onDisk) Get(resourceKind, resourceAPIVersion, k8sVersion string) (inter
return nil, err
}
return ioutil.ReadAll(f)
return io.ReadAll(f)
}
// Set adds a JSON schema to the schema cache
func (c *onDisk) Set(resourceKind, resourceAPIVersion, k8sVersion string, schema interface{}) error {
c.Lock()
defer c.Unlock()
return ioutil.WriteFile(cachePath(c.folder, resourceKind, resourceAPIVersion, k8sVersion), schema.([]byte), 0644)
return os.WriteFile(cachePath(c.folder, resourceKind, resourceAPIVersion, k8sVersion), schema.([]byte), 0644)
}