From e2214106eeb2d7ed41e6a0c2f0eb02d7815d0b97 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 9 Jun 2013 23:06:47 -0700 Subject: [PATCH] packer: Cache keys should be hex encoded to string --- packer/cache.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packer/cache.go b/packer/cache.go index 6a367253a..6f8d14134 100644 --- a/packer/cache.go +++ b/packer/cache.go @@ -2,6 +2,7 @@ package packer import ( "crypto/sha256" + "encoding/hex" "path/filepath" "sync" ) @@ -69,7 +70,7 @@ func (f *FileCache) RUnlock(key string) { func (f *FileCache) hashKey(key string) string { sha := sha256.New() sha.Write([]byte(key)) - return string(sha.Sum(nil)) + return hex.EncodeToString(sha.Sum(nil)) } func (f *FileCache) rwLock(hashKey string) *sync.RWMutex {