Commit bf6786bb authored by Michael Yang's avatar Michael Yang
Browse files

fix tautology

parent ad887994
...@@ -102,16 +102,14 @@ func RunHandler(cmd *cobra.Command, args []string) error { ...@@ -102,16 +102,14 @@ func RunHandler(cmd *cobra.Command, args []string) error {
name := args[0] name := args[0]
// check if the model exists on the server // check if the model exists on the server
_, err = client.Show(context.Background(), &api.ShowRequest{Name: name}) _, err = client.Show(context.Background(), &api.ShowRequest{Name: name})
if err != nil { var statusError api.StatusError
var statusError api.StatusError switch {
switch { case errors.As(err, &statusError) && statusError.StatusCode == http.StatusNotFound:
case errors.As(err, &statusError) && statusError.StatusCode == http.StatusNotFound: if err := PullHandler(cmd, args); err != nil {
if err := PullHandler(cmd, args); err != nil {
return err
}
case err != nil:
return err return err
} }
case err != nil:
return err
} }
return RunGenerate(cmd, args) return RunGenerate(cmd, args)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment