code: func (a Artifact) Checksum(algorithm string) (string, error) {
  	log.Debugf("calculating checksum for %s", a.Path)
  	file, err := os.Open(a.Path)
  	if err != nil {
  		return "", errors.Wrap(err, "failed to checksum")
  	}
  	defer file.Close() // nolint: errcheck
  	var h hash.Hash
  	switch algorithm {
  	case "crc32":
  		h = crc32.NewIEEE()
  	case "md5":
  		h = md5.New()
  	case "sha224":
  		h = sha256.New224()
  	case "sha384":
  		h = sha512.New384()
  	case "sha256":
  		h = sha256.New()
  	case "sha1":
  		h = sha1.New()
  	case "sha512":
  		h = sha512.New()
  	default:
  		return "", fmt.Errorf("invalid algorith: %s", algorithm)
  	}
  	_, err = io.Copy(h, file)
  	if err != nil {
  		return "", errors.Wrap(err, "failed to checksum")
  	}
  	return hex.EncodeToString(h.Sum(nil)), nil
  }
docs: // Checksum calculates the checksum of the artifact.
  // nolint: gosec