(fullPath string)
| 59 | } |
| 60 | |
| 61 | func hashFile(fullPath string) (string, error) { |
| 62 | file, err := os.Open(fullPath) |
| 63 | if err != nil { |
| 64 | return "", err |
| 65 | } |
| 66 | defer file.Close() |
| 67 | |
| 68 | hasher := sha256.New() |
| 69 | if _, err := io.Copy(hasher, file); err != nil { |
| 70 | return "", err |
| 71 | } |
| 72 | |
| 73 | hash := hasher.Sum(nil) |
| 74 | return fmt.Sprintf("%x", hash), nil |
| 75 | } |