chore(deps): update golangci-lint
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
kolaente 2025-03-02 13:00:18 +01:00
parent 1d1295e065
commit 4e90c6bb78
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
11 changed files with 32 additions and 26 deletions

View File

@ -138,7 +138,7 @@ steps:
event: [ push, tag, pull_request ]
- name: api-lint
image: golangci/golangci-lint:v1.61.0
image: golangci/golangci-lint:v1.64.5
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
@ -1214,6 +1214,6 @@ steps:
---
kind: signature
hmac: bf9f28a874dae9397c45062a2e1c8839ab9624b2cf265838577e1baad7fe3d03
hmac: 3aa9604902b5bf7b6eb0db09fdaf833b78215005e7371c686a7e0723755c84f4
...

View File

@ -119,3 +119,9 @@ issues:
- text: 'G115: integer overflow conversion int -> uint64'
linters:
- gosec
- text: 'the methods of "Right" use pointer receiver and non-pointer receiver.'
linters:
- recvcheck
- text: 'the methods of "SubscriptionEntityType" use pointer receiver and non-pointer receiver.'
linters:
- recvcheck

View File

@ -109,11 +109,11 @@ func initMysqlEngine() (engine *xorm.Engine, err error) {
}
engine.SetMaxOpenConns(config.DatabaseMaxOpenConnections.GetInt())
engine.SetMaxIdleConns(config.DatabaseMaxIdleConnections.GetInt())
max, err := time.ParseDuration(strconv.Itoa(config.DatabaseMaxConnectionLifetime.GetInt()) + `ms`)
maxLifetime, err := time.ParseDuration(strconv.Itoa(config.DatabaseMaxConnectionLifetime.GetInt()) + `ms`)
if err != nil {
return
}
engine.SetConnMaxLifetime(max)
engine.SetConnMaxLifetime(maxLifetime)
return
}
@ -168,11 +168,11 @@ func initPostgresEngine() (engine *xorm.Engine, err error) {
engine.SetSchema(config.DatabaseSchema.GetString())
engine.SetMaxOpenConns(config.DatabaseMaxOpenConnections.GetInt())
engine.SetMaxIdleConns(config.DatabaseMaxIdleConnections.GetInt())
max, err := time.ParseDuration(strconv.Itoa(config.DatabaseMaxConnectionLifetime.GetInt()) + `ms`)
maxLifetime, err := time.ParseDuration(strconv.Itoa(config.DatabaseMaxConnectionLifetime.GetInt()) + `ms`)
if err != nil {
return
}
engine.SetConnMaxLifetime(max)
engine.SetConnMaxLifetime(maxLifetime)
return
}

View File

@ -1763,7 +1763,7 @@ func (err *ErrUnknownSubscriptionEntityType) Error() string {
const ErrCodeUnknownSubscriptionEntityType = 12001
// HTTPError holds the http error description
func (err ErrUnknownSubscriptionEntityType) HTTPError() web.HTTPError {
func (err *ErrUnknownSubscriptionEntityType) HTTPError() web.HTTPError {
return web.HTTPError{
HTTPCode: http.StatusPreconditionFailed,
Code: ErrCodeUnknownSubscriptionEntityType,
@ -1792,7 +1792,7 @@ func (err *ErrSubscriptionAlreadyExists) Error() string {
const ErrCodeSubscriptionAlreadyExists = 12002
// HTTPError holds the http error description
func (err ErrSubscriptionAlreadyExists) HTTPError() web.HTTPError {
func (err *ErrSubscriptionAlreadyExists) HTTPError() web.HTTPError {
return web.HTTPError{
HTTPCode: http.StatusPreconditionFailed,
Code: ErrCodeSubscriptionAlreadyExists,
@ -1818,7 +1818,7 @@ func (err *ErrMustProvideUser) Error() string {
const ErrCodeMustProvideUser = 12003
// HTTPError holds the http error description
func (err ErrMustProvideUser) HTTPError() web.HTTPError {
func (err *ErrMustProvideUser) HTTPError() web.HTTPError {
return web.HTTPError{
HTTPCode: http.StatusPreconditionFailed,
Code: ErrCodeMustProvideUser,
@ -1849,7 +1849,7 @@ func (err *ErrLinkSharePasswordRequired) Error() string {
const ErrCodeLinkSharePasswordRequired = 13001
// HTTPError holds the http error description
func (err ErrLinkSharePasswordRequired) HTTPError() web.HTTPError {
func (err *ErrLinkSharePasswordRequired) HTTPError() web.HTTPError {
return web.HTTPError{
HTTPCode: http.StatusPreconditionFailed,
Code: ErrCodeLinkSharePasswordRequired,
@ -1876,7 +1876,7 @@ func (err *ErrLinkSharePasswordInvalid) Error() string {
const ErrCodeLinkSharePasswordInvalid = 13002
// HTTPError holds the http error description
func (err ErrLinkSharePasswordInvalid) HTTPError() web.HTTPError {
func (err *ErrLinkSharePasswordInvalid) HTTPError() web.HTTPError {
return web.HTTPError{
HTTPCode: http.StatusForbidden,
Code: ErrCodeLinkSharePasswordInvalid,
@ -1902,7 +1902,7 @@ func (err *ErrLinkShareTokenInvalid) Error() string {
const ErrCodeLinkShareTokenInvalid = 13003
// HTTPError holds the http error description
func (err ErrLinkShareTokenInvalid) HTTPError() web.HTTPError {
func (err *ErrLinkShareTokenInvalid) HTTPError() web.HTTPError {
return web.HTTPError{
HTTPCode: http.StatusBadRequest,
Code: ErrCodeLinkShareTokenInvalid,
@ -1932,7 +1932,7 @@ func (err *ErrAPITokenInvalid) Error() string {
const ErrCodeAPITokenInvalid = 14001
// HTTPError holds the http error description
func (err ErrAPITokenInvalid) HTTPError() web.HTTPError {
func (err *ErrAPITokenInvalid) HTTPError() web.HTTPError {
return web.HTTPError{
HTTPCode: http.StatusBadRequest,
Code: ErrCodeAPITokenInvalid,
@ -1960,7 +1960,7 @@ func (err *ErrInvalidAPITokenPermission) Error() string {
const ErrCodeInvalidAPITokenPermission = 14002
// HTTPError holds the http error description
func (err ErrInvalidAPITokenPermission) HTTPError() web.HTTPError {
func (err *ErrInvalidAPITokenPermission) HTTPError() web.HTTPError {
return web.HTTPError{
HTTPCode: http.StatusBadRequest,
Code: ErrCodeInvalidAPITokenPermission,

View File

@ -75,7 +75,7 @@ type LinkSharing struct {
}
// TableName holds the table name
func (LinkSharing) TableName() string {
func (*LinkSharing) TableName() string {
return "link_shares"
}

View File

@ -48,7 +48,7 @@ type TeamProject struct {
}
// TableName makes beautiful table names
func (TeamProject) TableName() string {
func (*TeamProject) TableName() string {
return "team_projects"
}
@ -158,7 +158,7 @@ func (tl *TeamProject) Delete(s *xorm.Session, _ web.Auth) (err error) {
// Delete the relation
_, err = s.Where("team_id = ?", tl.TeamID).
And("project_id = ?", tl.ProjectID).
Delete(TeamProject{})
Delete(&TeamProject{})
if err != nil {
return err
}

View File

@ -51,7 +51,7 @@ type ProjectUser struct {
}
// TableName is the table name for ProjectUser
func (ProjectUser) TableName() string {
func (*ProjectUser) TableName() string {
return "users_projects"
}

View File

@ -216,9 +216,9 @@ func TestSavedFilter_Rights(t *testing.T) {
ID: 1,
Title: "Lorem",
}
can, max, err := sf.CanRead(s, user1)
can, maxRight, err := sf.CanRead(s, user1)
require.NoError(t, err)
assert.Equal(t, int(RightAdmin), max)
assert.Equal(t, int(RightAdmin), maxRight)
assert.True(t, can)
})
t.Run("not owner", func(t *testing.T) {

View File

@ -40,7 +40,7 @@ type TaskAssginee struct {
}
// TableName makes a pretty table name
func (TaskAssginee) TableName() string {
func (*TaskAssginee) TableName() string {
return "task_assignees"
}
@ -77,7 +77,7 @@ func (t *Task) updateTaskAssignees(s *xorm.Session, assignees []*user.User, doer
// If we don't have any new assignees, delete everything right away. Saves us some hassle.
if len(assignees) == 0 && len(t.Assignees) > 0 {
_, err = s.Where("task_id = ?", t.ID).
Delete(TaskAssginee{})
Delete(&TaskAssginee{})
t.setTaskAssignees(assignees)
return err
}
@ -115,7 +115,7 @@ func (t *Task) updateTaskAssignees(s *xorm.Session, assignees []*user.User, doer
if len(assigneesToDelete) > 0 {
_, err = s.In("user_id", assigneesToDelete).
And("task_id = ?", t.ID).
Delete(TaskAssginee{})
Delete(&TaskAssginee{})
if err != nil {
return err
}
@ -253,7 +253,7 @@ func (t *Task) addNewAssigneeByID(s *xorm.Session, newAssigneeID int64, project
}
}
_, err = s.Insert(TaskAssginee{
_, err = s.Insert(&TaskAssginee{
TaskID: t.ID,
UserID: newAssigneeID,
})

View File

@ -1606,7 +1606,7 @@ func (t *Task) Delete(s *xorm.Session, a web.Auth) (err error) {
}
// Delete assignees
if _, err = s.Where("task_id = ?", t.ID).Delete(TaskAssginee{}); err != nil {
if _, err = s.Where("task_id = ?", t.ID).Delete(&TaskAssginee{}); err != nil {
return err
}

View File

@ -65,7 +65,7 @@ type Team struct {
}
// TableName makes beautiful table names
func (Team) TableName() string {
func (*Team) TableName() string {
return "teams"
}