Repository: goreleaser/goreleaser
Pull request #1785 (2020-09-02 19:22:15)

fix: typo in artifact checksum error message
Simple typo fix.


codecov[bot]: # [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/1785?src=pr&el=h1) Report
> Merging [#1785](https://codecov.io/gh/goreleaser/goreleaser/pull/1785?src=pr&el=desc) into [master](https://codecov.io/gh/goreleaser/goreleaser/commit/9cbc01050bfa6494e8e54bef071f61e24d30cd96?el=desc) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/goreleaser/goreleaser/pull/1785/graphs/tree.svg?width=650&height=150&src=pr&token=3bJvv6b7hN)](https://codecov.io/gh/goreleaser/goreleaser/pull/1785?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master    #1785   +/-   ##
=======================================
  Coverage   82.55%   82.55%           
=======================================
  Files          72       72           
  Lines        4179     4179           
=======================================
  Hits         3450     3450           
  Misses        608      608           
  Partials      121      121           
```


| [Impacted Files](https://codecov.io/gh/goreleaser/goreleaser/pull/1785?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [internal/artifact/artifact.go](https://codecov.io/gh/goreleaser/goreleaser/pull/1785/diff?src=pr&el=tree#diff-aW50ZXJuYWwvYXJ0aWZhY3QvYXJ0aWZhY3QuZ28=) | `79.52% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/1785?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/1785?src=pr&el=footer). Last update [9cbc010...e496513](https://codecov.io/gh/goreleaser/goreleaser/pull/1785?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/internal/artifact/artifact.go b/internal/artifact/artifact.go
index 2883acf2..72539422 100644
--- a/internal/artifact/artifact.go
+++ b/internal/artifact/artifact.go
@@ -55,16 +55,13 @@ func (t Type) String() string {
 		return "Archive"
 	case UploadableFile:
 		return "File"
-	case UploadableBinary:
-	case Binary:
+	case UploadableBinary, Binary:
 		return "Binary"
 	case LinuxPackage:
 		return "Linux Package"
-	case DockerImage:
-	case PublishableDockerImage:
+	case PublishableDockerImage, DockerImage:
 		return "Docker Image"
-	case PublishableSnapcraft:
-	case Snapcraft:
+	case PublishableSnapcraft, Snapcraft:
 		return "Snap"
 	case Checksum:
 		return "Checksum"
@@ -72,8 +69,9 @@ func (t Type) String() string {
 		return "Signature"
 	case UploadableSourceArchive:
 		return "Source"
+	default:
+		return "unknown"
 	}
-	return "unknown"
 }
 
 // Artifact represents an artifact and its relevant info.
@@ -123,7 +121,7 @@ func (a Artifact) Checksum(algorithm string) (string, error) {
 	case "sha512":
 		h = sha512.New()
 	default:
-		return "", fmt.Errorf("invalid algorith: %s", algorithm)
+		return "", fmt.Errorf("invalid algorithm: %s", algorithm)
 	}
 	_, err = io.Copy(h, file)
 	if err != nil {


Test patch:
diff --git a/internal/artifact/artifact_test.go b/internal/artifact/artifact_test.go
index b452d94c..bf122cf9 100644
--- a/internal/artifact/artifact_test.go
+++ b/internal/artifact/artifact_test.go
@@ -198,7 +198,7 @@ func TestInvalidAlgorithm(t *testing.T) {
 		Path: f.Name(),
 	}
 	sum, err := artifact.Checksum("sha1ssss")
-	require.EqualError(t, err, `invalid algorith: sha1ssss`)
+	require.EqualError(t, err, `invalid algorithm: sha1ssss`)
 	require.Empty(t, sum)
 }