Skip to content

Commit

Permalink
Merge pull request #20 from symfony-cli/deps-bump
Browse files Browse the repository at this point in the history
Deps bump
  • Loading branch information
fabpot authored May 5, 2024
2 parents 81cf7b8 + 13fc48c commit 90b449c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
Expand Down
7 changes: 3 additions & 4 deletions store.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sort"
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
}
}

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 90b449c

Please sign in to comment.