Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
silkeh committed Oct 15, 2023
1 parent 1f38fd9 commit 85cbb2c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ linters-settings:
stylecheck:
checks: [all]

tagliatelle:
case:
rules:
json: goCamel

wrapcheck:
ignoreSigs:
- .Errorf(
Expand Down
18 changes: 9 additions & 9 deletions pkg/alertmanager/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ const (

// Message represents a message received from Alertmanager via webhook.
type Message struct {
Version string
GroupKey string
Status string
Receiver string
GroupLabels map[string]string
CommonLabels map[string]string
CommonAnnotations map[string]string
ExternalURL string
Alerts []*Alert
Version string `json:"version"`
GroupKey string `json:"groupKey"`
Status string `json:"status"`
Receiver string `json:"receiver"`
GroupLabels map[string]string `json:"groupLabels"`
CommonLabels map[string]string `json:"commonLabels"`
CommonAnnotations map[string]string `json:"commonAnnotations"`
ExternalURL string `json:"externalURL"`
Alerts []*Alert `json:"alerts"`
}

// Alert represents an Alert received from Alertmanager via webhook.
Expand Down
6 changes: 3 additions & 3 deletions pkg/bot/matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewClient(config *ClientConfig, formatter *Formatter) (client *Client, err
// Create Alertmanager client
client.Alertmanager, err = alertmanager.NewClient(config.AlertManagerURL)
if err != nil {
return
return nil, fmt.Errorf("error creating Alertmanager client: %w", err)
}

// Matrix bot config
Expand All @@ -65,7 +65,7 @@ func NewClient(config *ClientConfig, formatter *Formatter) (client *Client, err
// Create Matrix client
client.Matrix, err = bot.NewClient(config.Homeserver, config.UserID, config.Token, matrixConfig)
if err != nil {
return
return nil, fmt.Errorf("error creating Matrix client: %w", err)
}

// Create room list
Expand All @@ -78,7 +78,7 @@ func NewClient(config *ClientConfig, formatter *Formatter) (client *Client, err
client.Matrix.SetCommand("list", client.listCommand())
client.Matrix.SetCommand("silence", client.silenceCommand())

return
return client, nil
}

// mainCommand returns the `alert` bot command.
Expand Down

0 comments on commit 85cbb2c

Please sign in to comment.