From a3ead3d67520704eda55a74841b00d5766728fab Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Thu, 7 Sep 2023 22:04:12 +0530 Subject: Correctly formatting source files using go fmt --- hasher/blake2-hash_generator.go | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'hasher') diff --git a/hasher/blake2-hash_generator.go b/hasher/blake2-hash_generator.go index 4d85a58..e71a736 100644 --- a/hasher/blake2-hash_generator.go +++ b/hasher/blake2-hash_generator.go @@ -1,30 +1,30 @@ package hasher import ( - "fmt" - "golang.org/x/crypto/blake2b" - "io" - "os" + "fmt" + "golang.org/x/crypto/blake2b" + "io" + "os" ) func CalculateBLAKE2Hash(filePath string) (string, error) { - file, err := os.Open(filePath) - if err != nil { - return "", err - } - defer file.Close() + file, err := os.Open(filePath) + if err != nil { + return "", err + } + defer file.Close() - hash, err := blake2b.New256(nil) - if err != nil { - return "", err - } + hash, err := blake2b.New256(nil) + if err != nil { + return "", err + } - _, err = io.Copy(hash, file) - if err != nil { - return "", err - } + _, err = io.Copy(hash, file) + if err != nil { + return "", err + } - hashBytes := hash.Sum(nil) - hashString := fmt.Sprintf("%x", hashBytes) - return hashString, nil + hashBytes := hash.Sum(nil) + hashString := fmt.Sprintf("%x", hashBytes) + return hashString, nil } -- cgit v1.2.3