replaced ioutil.ReadDir by os.ReadDir
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2022-11-02 17:13:35 +01:00
parent b102d2e916
commit 6cef9b045f

4
src/cache/cache.go vendored
View File

@ -5,7 +5,6 @@ import (
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"log" "log"
"mime" "mime"
"net/http" "net/http"
@ -145,8 +144,9 @@ func (c *Cache) Close() {
c.waitGroup.Wait() c.waitGroup.Wait()
} }
// Migrate converts old files to newer format
func (c *Cache) Migrate(pathname *string) (err error) { func (c *Cache) Migrate(pathname *string) (err error) {
files, err := ioutil.ReadDir(*pathname) files, err := os.ReadDir(*pathname)
for _, f := range files { for _, f := range files {
if strings.HasSuffix(f.Name(), ".json") { if strings.HasSuffix(f.Name(), ".json") {
basename := strings.Split(f.Name(), ".")[0] basename := strings.Split(f.Name(), ".")[0]