Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: David Gageot <david@gageot.net>
  • Loading branch information
dgageot committed Jun 1, 2018
1 parent 62c5931 commit 92f15d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pkg/skaffold/build/tag/date_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ type dateTimeTagger struct {
timeFn func() time.Time
}

func NewDateTimeTagger(format, timezone string) (*dateTimeTagger, error) {
// NewDateTimeTagger creates a tagger from a date format and timezone.
func NewDateTimeTagger(format, timezone string) Tagger {
return &dateTimeTagger{
Format: format,
TimeZone: timezone,
timeFn: func() time.Time { return time.Now() },
}, nil
}
}

// GenerateFullyQualifiedImageName tags an image with the supplied image name and the current timestamp
Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/build/tag/env_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type envTemplateTagger struct {
}

// NewEnvTemplateTagger creates a new envTemplateTagger
func NewEnvTemplateTagger(t string) (*envTemplateTagger, error) {
func NewEnvTemplateTagger(t string) (Tagger, error) {
tmpl, err := util.ParseEnvTemplate(t)
if err != nil {
return nil, errors.Wrap(err, "parsing template")
Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func getTagger(t v1alpha2.TagPolicy, customTag string) (tag.Tagger, error) {
return &tag.GitCommit{}, nil

case t.DateTimeTagger != nil:
return tag.NewDateTimeTagger(t.DateTimeTagger.Format, t.DateTimeTagger.TimeZone)
return tag.NewDateTimeTagger(t.DateTimeTagger.Format, t.DateTimeTagger.TimeZone), nil

default:
return nil, fmt.Errorf("Unknown tagger for strategy %+v", t)
Expand Down

0 comments on commit 92f15d3

Please sign in to comment.