with package id

This commit is contained in:
Alex Goodman
2020-05-29 16:06:31 -04:00
parent dcba50eaa8
commit a0e48468c2
13 changed files with 96 additions and 34 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ type artifact struct {
Metadata interface{} `json:"metadata"`
}
func (pres *Presenter) Present(output io.Writer, img *stereoscopeImg.Image, catalog pkg.Catalog) error {
func (pres *Presenter) Present(output io.Writer, img *stereoscopeImg.Image, catalog *pkg.Catalog) error {
tags := make([]string, len(img.Metadata.Tags))
for idx, tag := range img.Metadata.Tags {
tags[idx] = tag.String()
+2 -2
View File
@@ -16,7 +16,7 @@ var Options = []Option{
JSONPresenter,
}
type Option uint
type Option int
func ParseOption(userStr string) Option {
switch strings.ToLower(userStr) {
@@ -28,7 +28,7 @@ func ParseOption(userStr string) Option {
}
func (o Option) String() string {
if int(o) >= len(optionStr) {
if int(o) >= len(optionStr) || o < 0 {
return optionStr[0]
}
+1 -1
View File
@@ -9,7 +9,7 @@ import (
)
type Presenter interface {
Present(io.Writer, *image.Image, pkg.Catalog) error
Present(io.Writer, *image.Image, *pkg.Catalog) error
}
func GetPresenter(option Option) Presenter {