From ca7a84b8aea203025acbda193f78ea98946236b5 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 8 Apr 2022 23:16:59 -0700 Subject: Switch to google.golang.org/protobuf/proto github.com/golang/protobuf/proto has been deprecated in favor of google.golang.org/protobuf/proto, so migrate to the non-deprecated one. --- actions/config.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actions/config.go') 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) -- cgit v1.2.3