Showing 4 of 6 total issues
Method Service.send
has 7 return statements (exceeds 4 allowed). Open
Open
func (s *Service) send(ctx context.Context, serverURL, subject, content string) error {
if serverURL == "" {
return errors.New("server url is empty")
}
Function setupLoginService
has 6 return statements (exceeds 4 allowed). Open
Open
func setupLoginService(url string, msgService *http.Service) *http.Service {
// create another new http client for login request call.
httpService := http.New()
// append login path for the given mattermost server with custom payload builder.
Function New
has 5 return statements (exceeds 4 allowed). Open
Open
func New(cOpts *ClientOptions, mOpts *MessageOptions) (*Service, error) {
if cOpts == nil {
return nil, errors.New("client-options cannot be nil")
}
Method Service.do
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *Service) do(req *http.Request) error {
// Execute all pre-send hooks in order.
if err := s.doPreSendHooks(req); err != nil {
return fmt.Errorf("pre-send hooks: %w", err)
}