Update Golang to 1.21.4 (#245)

This commit is contained in:
Yann Hamon 2023-11-18 18:31:34 +01:00 committed by GitHub
parent 6ae8c45bc1
commit d8f00a3a30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 452 additions and 134 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)
}