diff --git a/client.go b/client.go index ef7a28a72..058d6d836 100644 --- a/client.go +++ b/client.go @@ -394,15 +394,7 @@ func (c *Client) ExportCSV(ctx context.Context, index, frame, view string, slice return ErrIndexRequired } else if frame == "" { return ErrFrameRequired - } - foundView := false - for _, v := range []string{ViewInverse, ViewStandard} { - if view == v { - foundView = true - break - } - } - if foundView == false { + } else if !(view == ViewStandard || view == ViewInverse) { return ErrInvalidView } diff --git a/ctl/export.go b/ctl/export.go index 63266a8d6..7da310623 100644 --- a/ctl/export.go +++ b/ctl/export.go @@ -49,22 +49,13 @@ func NewExportCommand(stdin io.Reader, stdout, stderr io.Writer) *ExportCommand // Run executes the export. func (cmd *ExportCommand) Run(ctx context.Context) error { logger := log.New(cmd.Stderr, "", log.LstdFlags) - foundView := false // Validate arguments. if cmd.Index == "" { return pilosa.ErrIndexRequired } else if cmd.Frame == "" { return pilosa.ErrFrameRequired - } - - for _, v := range []string{pilosa.ViewInverse, pilosa.ViewStandard} { - if cmd.View == v { - foundView = true - break - } - } - if foundView == false { + } else if !(cmd.View == pilosa.ViewStandard || cmd.View == pilosa.ViewInverse) { return pilosa.ErrInvalidView }