diff --git a/drone/commit.go b/drone/commit.go index 6b7fbca..527b310 100644 --- a/drone/commit.go +++ b/drone/commit.go @@ -55,6 +55,10 @@ type ( } ) +func (c Commit) String() string { + return c.SHA +} + func (a Author) String() string { return a.Username } diff --git a/drone/repo.go b/drone/repo.go index 1bc4516..80aadc1 100644 --- a/drone/repo.go +++ b/drone/repo.go @@ -37,3 +37,7 @@ type Repo struct { // Private to show if the repo is private. Private bool } + +func (r Repo) String() string { + return r.Slug +} diff --git a/drone/semver.go b/drone/semver.go index 1eb70a5..803b89c 100644 --- a/drone/semver.go +++ b/drone/semver.go @@ -37,3 +37,7 @@ type SemVer struct { // Error is the semantic version parsing error if the tag was invalid. Error string } + +func (s SemVer) String() string { + return s.Version +} diff --git a/drone/stage.go b/drone/stage.go index eb78ec7..38769cf 100644 --- a/drone/stage.go +++ b/drone/stage.go @@ -5,9 +5,7 @@ package drone -import ( - "time" -) +import "time" // Stage represents a build stage. type Stage struct { @@ -62,3 +60,7 @@ type Stage struct { // DependsOn is a list of dependencies for the current build stage. DependsOn []string } + +func (s Stage) String() string { + return s.Name +} diff --git a/drone/step.go b/drone/step.go index d944340..1f6ed9d 100644 --- a/drone/step.go +++ b/drone/step.go @@ -13,3 +13,7 @@ type Step struct { // Number is the numeric value of the step. Number int } + +func (s Step) String() string { + return s.Name +} diff --git a/drone/system.go b/drone/system.go index 102a05a..885e244 100644 --- a/drone/system.go +++ b/drone/system.go @@ -16,3 +16,7 @@ type System struct { // Version for the system version. Version string } + +func (s System) String() string { + return s.Host +}