1
0
mirror of https://github.com/drone/drone-cli.git synced 2026-01-20 18:01:34 +01:00
drone-cli/vendor/github.com/drone/drone-yaml/yaml/push.go
2018-09-13 18:41:12 -07:00

26 lines
505 B
Go

package yaml
type (
// Push configures a Docker push.
Push struct {
Image string `json:"image,omitempty"`
}
// push is a tempoary type used to unmarshal
// the Push struct when long format is used.
push struct {
Image string `json:"image,omitempty"`
}
)
// UnmarshalYAML implements yaml unmarhsaling.
func (p *Push) UnmarshalYAML(unmarshal func(interface{}) error) error {
d := new(push)
err := unmarshal(&d.Image)
if err != nil {
err = unmarshal(d)
}
p.Image = d.Image
return err
}