Fix golangci-lint warnings

- fix spelling
- mark false positives of bodyclose (see
  https://github.com/timakin/bodyclose/issues/30)
main
Jan Dittberner 2 years ago
parent c1c9ed5dec
commit 57fd5364fc

@ -55,21 +55,21 @@ func (m *templateData) motionPaginationOptions(limit int, first, last *time.Time
motions := m.Motions
if len(motions) == limit && first.Before(motions[len(motions)-1].Proposed) {
marshalled, err := motions[len(motions)-1].Proposed.MarshalText()
marshaled, err := motions[len(motions)-1].Proposed.MarshalText()
if err != nil {
return fmt.Errorf("could not serialize timestamp: %w", err)
}
m.NextPage = string(marshalled)
m.NextPage = string(marshaled)
}
if len(motions) > 0 && last.After(motions[0].Proposed) {
marshalled, err := motions[0].Proposed.MarshalText()
marshaled, err := motions[0].Proposed.MarshalText()
if err != nil {
return fmt.Errorf("could not serialize timestamp: %w", err)
}
m.PrevPage = string(marshalled)
m.PrevPage = string(marshaled)
}
return nil

@ -102,7 +102,7 @@ func TestApplication_healthCheck(t *testing.T) {
app.healthCheck(rr, r)
rs := rr.Result()
rs := rr.Result() //nolint:bodyclose // linters bug
defer func() { _ = rs.Body.Close() }()
@ -133,7 +133,7 @@ func TestApplication_healthCheck(t *testing.T) {
app.healthCheck(rr, r)
rs := rr.Result()
rs := rr.Result() //nolint:bodyclose // linters bug
defer func() { _ = rs.Body.Close() }()

@ -47,7 +47,7 @@ func Test_secureHeaders(t *testing.T) {
secureHeaders(next).ServeHTTP(rr, r)
rs := rr.Result()
rs := rr.Result() //nolint:bodyclose // linters bug
defer func() { _ = rs.Body.Close() }()
@ -104,7 +104,7 @@ func TestApplication_tryAuthenticate(t *testing.T) {
app.tryAuthenticate(next).ServeHTTP(rr, r)
rs := rr.Result()
rs := rr.Result() //nolint:bodyclose // linters bug
defer func() { _ = rs.Body.Close() }()
@ -122,7 +122,7 @@ func TestApplication_tryAuthenticate(t *testing.T) {
app.tryAuthenticate(next).ServeHTTP(rr, r)
rs := rr.Result()
rs := rr.Result() //nolint:bodyclose // linters bug
defer func() { _ = rs.Body.Close() }()
@ -143,7 +143,7 @@ func TestApplication_tryAuthenticate(t *testing.T) {
app.tryAuthenticate(next).ServeHTTP(rr, r)
rs := rr.Result()
rs := rr.Result() //nolint:bodyclose // linters bug
defer func() { _ = rs.Body.Close() }()

@ -219,7 +219,7 @@ func (c *ClosedDecisionNotification) GetNotificationContent(mc *mailConfig) *Not
data: struct {
*models.Motion
}{Motion: c.Decision},
subject: fmt.Sprintf("Re: %s - %s - finalised", c.Decision.Tag, c.Decision.Title),
subject: fmt.Sprintf("Re: %s - %s - finalized", c.Decision.Tag, c.Decision.Title),
headers: motionReplyHeaders(c.Decision),
recipients: []recipientData{defaultRecipient(mc)},
}

Loading…
Cancel
Save