sha256File computes the SHA256 hash of a file and returns the hex string.
(path string)
| 288 | |
| 289 | // sha256File computes the SHA256 hash of a file and returns the hex string. |
| 290 | func sha256File(path string) (string, error) { |
| 291 | f, err := os.Open(path) |
| 292 | if err != nil { |
| 293 | return "", err |
| 294 | } |
| 295 | defer f.Close() |
| 296 | |
| 297 | h := sha256.New() |
| 298 | if _, err := io.Copy(h, f); err != nil { |
| 299 | return "", err |
| 300 | } |
| 301 | return hex.EncodeToString(h.Sum(nil)), nil |
| 302 | } |
| 303 | |
| 304 | func installMySQL() error { |
| 305 | log.Println("--- Installing MySQL 9 ---") |
no test coverage detected