diff --git a/go.mod b/go.mod index c26bfe2..9d3613e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/symfony-cli/phpstore go 1.17 require ( - github.com/hashicorp/go-version v1.3.0 + github.com/hashicorp/go-version v1.6.0 github.com/mitchellh/go-homedir v1.1.0 github.com/pkg/errors v0.9.1 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 9d8337d..d60427a 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= -github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= diff --git a/store.go b/store.go index fad3161..17b7961 100644 --- a/store.go +++ b/store.go @@ -23,7 +23,6 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" "os" "path/filepath" "sort" @@ -200,7 +199,7 @@ func (s *PHPStore) loadVersions() { // disk cache? cache := filepath.Join(s.configDir, "php_versions.json") if _, err := os.Stat(cache); err == nil { - if contents, err := ioutil.ReadFile(cache); err == nil { + if contents, err := os.ReadFile(cache); err == nil { var vs versions if err := json.Unmarshal(contents, &vs); err == nil { for _, v := range vs { @@ -222,7 +221,7 @@ func (s *PHPStore) loadVersions() { s.discover() sort.Sort(s.versions) if contents, err := json.MarshalIndent(s.versions, "", " "); err == nil { - _ = ioutil.WriteFile(cache, contents, 0644) + _ = os.WriteFile(cache, contents, 0644) } } @@ -282,7 +281,7 @@ func (s *PHPStore) readVersion(file string) []byte { if _, err := os.Stat(file); err != nil { return nil } - contents, err := ioutil.ReadFile(file) + contents, err := os.ReadFile(file) if err != nil { return nil }