mirror of
https://github.com/thegeeklab/wp-plugin-go.git
synced 2024-11-25 09:30:39 +00:00
Add String() implementations for some structs (#20)
This commit is contained in:
parent
be2c206c20
commit
5113109fd1
@ -55,6 +55,10 @@ type (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (c Commit) String() string {
|
||||||
|
return c.SHA
|
||||||
|
}
|
||||||
|
|
||||||
func (a Author) String() string {
|
func (a Author) String() string {
|
||||||
return a.Username
|
return a.Username
|
||||||
}
|
}
|
||||||
|
@ -37,3 +37,7 @@ type Repo struct {
|
|||||||
// Private to show if the repo is private.
|
// Private to show if the repo is private.
|
||||||
Private bool
|
Private bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r Repo) String() string {
|
||||||
|
return r.Slug
|
||||||
|
}
|
||||||
|
@ -37,3 +37,7 @@ type SemVer struct {
|
|||||||
// Error is the semantic version parsing error if the tag was invalid.
|
// Error is the semantic version parsing error if the tag was invalid.
|
||||||
Error string
|
Error string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s SemVer) String() string {
|
||||||
|
return s.Version
|
||||||
|
}
|
||||||
|
@ -5,9 +5,7 @@
|
|||||||
|
|
||||||
package drone
|
package drone
|
||||||
|
|
||||||
import (
|
import "time"
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Stage represents a build stage.
|
// Stage represents a build stage.
|
||||||
type Stage struct {
|
type Stage struct {
|
||||||
@ -62,3 +60,7 @@ type Stage struct {
|
|||||||
// DependsOn is a list of dependencies for the current build stage.
|
// DependsOn is a list of dependencies for the current build stage.
|
||||||
DependsOn []string
|
DependsOn []string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s Stage) String() string {
|
||||||
|
return s.Name
|
||||||
|
}
|
||||||
|
@ -13,3 +13,7 @@ type Step struct {
|
|||||||
// Number is the numeric value of the step.
|
// Number is the numeric value of the step.
|
||||||
Number int
|
Number int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s Step) String() string {
|
||||||
|
return s.Name
|
||||||
|
}
|
||||||
|
@ -16,3 +16,7 @@ type System struct {
|
|||||||
// Version for the system version.
|
// Version for the system version.
|
||||||
Version string
|
Version string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s System) String() string {
|
||||||
|
return s.Host
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user