Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: better package organization
- Loading branch information
Showing
97 changed files
with
1,049 additions
and
1,087 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
dist/ | ||
!internal/pipeline/dist | ||
!internal/pipe/dist | ||
bin/ | ||
vendor | ||
coverage.txt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Package pipe provides generic erros for pipes to use. | ||
package pipe | ||
|
||
// ErrSnapshotEnabled happens when goreleaser is running in snapshot mode. | ||
// It usually means that publishing and maybe some validations were skipped. | ||
var ErrSnapshotEnabled = Skip("disabled during snapshot mode") | ||
|
||
// ErrSkipPublishEnabled happens if --skip-publish is set. | ||
// It means that the part of a Piper that publishes its artifacts was not run. | ||
var ErrSkipPublishEnabled = Skip("publishing is disabled") | ||
|
||
// ErrSkipSignEnabled happens if --skip-sign is set. | ||
// It means that the part of a Piper that signs some things was not run. | ||
var ErrSkipSignEnabled = Skip("artifact signing is disabled") | ||
|
||
// ErrSkipValidateEnabled happens if --skip-validate is set. | ||
// It means that the part of a Piper that validates some things was not run. | ||
var ErrSkipValidateEnabled = Skip("validation is disabled") | ||
|
||
// IsSkip returns true if the error is an ErrSkip | ||
func IsSkip(err error) bool { | ||
_, ok := err.(ErrSkip) | ||
return ok | ||
} | ||
|
||
// ErrSkip occurs when a pipe is skipped for some reason | ||
type ErrSkip struct { | ||
reason string | ||
} | ||
|
||
// Error implements the error interface. returns the reason the pipe was skipped | ||
func (e ErrSkip) Error() string { | ||
return e.reason | ||
} | ||
|
||
// Skip skips this pipe with the given reason | ||
func Skip(reason string) ErrSkip { | ||
return ErrSkip{reason: reason} | ||
} |
2 changes: 1 addition & 1 deletion
2
internal/pipeline/pipeline_test.go → internal/pipe/pipe_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package pipeline | ||
package pipe | ||
|
||
import ( | ||
"errors" | ||
|
File renamed without changes.
File renamed without changes.
Oops, something went wrong.