Skip to content

Commit

Permalink
only return err when not nil, for easier readability
Browse files Browse the repository at this point in the history
  • Loading branch information
hsmade committed Apr 25, 2023
1 parent f51fffd commit 31e4efa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions environments.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (s *EnvironmentsService) ListEnvironments(pid interface{}, opts *ListEnviro
return nil, resp, err
}

return envs, resp, err
return envs, resp, nil
}

// GetEnvironment gets a specific environment from a project.
Expand All @@ -109,7 +109,7 @@ func (s *EnvironmentsService) GetEnvironment(pid interface{}, environment int, o
return nil, resp, err
}

return env, resp, err
return env, resp, nil
}

// CreateEnvironmentOptions represents the available CreateEnvironment() options.
Expand Down Expand Up @@ -147,7 +147,7 @@ func (s *EnvironmentsService) CreateEnvironment(pid interface{}, opt *CreateEnvi
return nil, resp, err
}

return env, resp, err
return env, resp, nil
}

// EditEnvironmentOptions represents the available EditEnvironment() options.
Expand Down Expand Up @@ -182,7 +182,7 @@ func (s *EnvironmentsService) EditEnvironment(pid interface{}, environment int,
return nil, resp, err
}

return env, resp, err
return env, resp, nil
}

// DeleteEnvironment removes an environment from a project team.
Expand Down Expand Up @@ -225,6 +225,6 @@ func (s *EnvironmentsService) StopEnvironment(pid interface{}, environmentID int
if err != nil {
return nil, resp, err
}

return env, resp, nil
}

0 comments on commit 31e4efa

Please sign in to comment.