1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-20 03:59:26 +02:00

fix: artifact string method switch statement (#1786)

Existing implementation seemed to rely on implicit case fallthrough, which doesn't exist in Go. Moving default return to default case helps catch this error in the future, as it will cause a "missing return" compile error.

Signed-off-by: Andy Bursavich <abursavich@gmail.com>
This commit is contained in:
Andy Bursavich 2020-09-02 12:44:02 -07:00 committed by GitHub
parent 9cbc01050b
commit 005b67dbed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.