diff options
| author | Joseph Richey <joerichey@google.com> | 2022-04-09 01:44:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-09 01:44:51 -0700 |
| commit | 53dc5f37339f40e78cd0e91b358322cc9e589185 (patch) | |
| tree | 68eb53440456ff6cc9c6ecef8b0567510de5310a /actions/config.go | |
| parent | ce8a5583c1cc2327cf65a048cfd1083225dad50e (diff) | |
| parent | ba0a96b04b08f8c8b533d7dab7e6326c5ecd6ace (diff) | |
Merge pull request #354 from google/staticcheck-fix
Upgrade dependencies to latest version
Diffstat (limited to 'actions/config.go')
| -rw-r--r-- | actions/config.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actions/config.go b/actions/config.go index a8eb029..03d6b04 100644 --- a/actions/config.go +++ b/actions/config.go @@ -29,6 +29,7 @@ import ( "time" "golang.org/x/sys/unix" + "google.golang.org/protobuf/proto" "github.com/google/fscrypt/crypto" "github.com/google/fscrypt/filesystem" @@ -210,7 +211,7 @@ func getHashingCosts(target time.Duration) (*metadata.HashingCosts, error) { memoryKiBLimit := memoryBytesLimit() / 1024 for { // Store a copy of the previous costs - costsPrev := *costs + costsPrev := proto.Clone(costs).(*metadata.HashingCosts) tPrev := t // Double the memory up to the max, then double the time. @@ -223,7 +224,7 @@ func getHashingCosts(target time.Duration) (*metadata.HashingCosts, error) { // If our hashing failed, return the last good set of costs. if t, err = timeHashingCosts(costs); err != nil { log.Printf("Hashing with costs={%v} failed: %v\n", costs, err) - return &costsPrev, nil + return costsPrev, nil } log.Printf("Costs={%v}\t-> %v\n", costs, t) |