Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kkajla12 committed Oct 24, 2023
1 parent 846a9c0 commit 59c5e2b
Show file tree
Hide file tree
Showing 15 changed files with 10 additions and 25 deletions.
1 change: 0 additions & 1 deletion pkg/authz/objecttype/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ func (repo MySQLRepository) List(ctx context.Context, listParams service.ListPar
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down
1 change: 0 additions & 1 deletion pkg/authz/objecttype/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ func (repo PostgresRepository) List(ctx context.Context, listParams service.List
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down
1 change: 0 additions & 1 deletion pkg/authz/objecttype/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ func (repo SQLiteRepository) List(ctx context.Context, listParams service.ListPa
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down
1 change: 0 additions & 1 deletion pkg/authz/warrant/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ func (repo MySQLRepository) List(ctx context.Context, filterParams FilterParams,
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down
1 change: 0 additions & 1 deletion pkg/authz/warrant/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ func (repo PostgresRepository) List(ctx context.Context, filterParams FilterPara
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down
6 changes: 3 additions & 3 deletions pkg/authz/warrant/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
)

type Service interface {
Create(context.Context, CreateWarrantSpec) (*WarrantSpec, *wookie.Token, error)
List(context.Context, FilterParams, service.ListParams) ([]WarrantSpec, *service.Cursor, *service.Cursor, error)
Delete(context.Context, DeleteWarrantSpec) (*wookie.Token, error)
Create(ctx context.Context, spec CreateWarrantSpec) (*WarrantSpec, *wookie.Token, error)
List(ctx context.Context, filterParams FilterParams, listParams service.ListParams) ([]WarrantSpec, *service.Cursor, *service.Cursor, error)
Delete(ctx context.Context, spec DeleteWarrantSpec) (*wookie.Token, error)
}

type WarrantService struct {
Expand Down
1 change: 0 additions & 1 deletion pkg/authz/warrant/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ func (repo SQLiteRepository) List(ctx context.Context, filterParams FilterParams
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down
2 changes: 0 additions & 2 deletions pkg/event/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ func (repo MySQLRepository) ListResourceEvents(ctx context.Context, filterParams
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down Expand Up @@ -337,7 +336,6 @@ func (repo MySQLRepository) ListAccessEvents(ctx context.Context, filterParams A
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down
2 changes: 0 additions & 2 deletions pkg/event/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ func (repo PostgresRepository) ListResourceEvents(ctx context.Context, filterPar
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down Expand Up @@ -339,7 +338,6 @@ func (repo PostgresRepository) ListAccessEvents(ctx context.Context, filterParam
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down
12 changes: 6 additions & 6 deletions pkg/event/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import (
)

type EventRepository interface {
TrackResourceEvent(context.Context, ResourceEventModel) error
TrackResourceEvents(context.Context, []ResourceEventModel) error
ListResourceEvents(context.Context, ResourceEventFilterParams, service.ListParams) ([]ResourceEventModel, *service.Cursor, *service.Cursor, error)
TrackAccessEvent(context.Context, AccessEventModel) error
TrackAccessEvents(context.Context, []AccessEventModel) error
ListAccessEvents(context.Context, AccessEventFilterParams, service.ListParams) ([]AccessEventModel, *service.Cursor, *service.Cursor, error)
TrackResourceEvent(ctx context.Context, resourceEvent ResourceEventModel) error
TrackResourceEvents(ctx context.Context, resourceEvents []ResourceEventModel) error
ListResourceEvents(ctx context.Context, filterParams ResourceEventFilterParams, listParams service.ListParams) ([]ResourceEventModel, *service.Cursor, *service.Cursor, error)
TrackAccessEvent(ctx context.Context, accessEvent AccessEventModel) error
TrackAccessEvents(ctx context.Context, accessEvents []AccessEventModel) error
ListAccessEvents(ctx context.Context, filterParams AccessEventFilterParams, listParams service.ListParams) ([]AccessEventModel, *service.Cursor, *service.Cursor, error)
}

func NewRepository(db database.Database) (EventRepository, error) {
Expand Down
2 changes: 0 additions & 2 deletions pkg/event/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ func (repo SQLiteRepository) ListResourceEvents(ctx context.Context, filterParam
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down Expand Up @@ -341,7 +340,6 @@ func (repo SQLiteRepository) ListAccessEvents(ctx context.Context, filterParams
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/object/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Model interface {
GetObjectType() string
GetObjectId() string
GetMeta() *string
SetMeta(map[string]interface{}) error
SetMeta(meta map[string]interface{}) error
GetCreatedAt() time.Time
GetUpdatedAt() time.Time
GetDeletedAt() *time.Time
Expand Down
1 change: 0 additions & 1 deletion pkg/object/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ func (repo MySQLRepository) List(ctx context.Context, filterOptions *FilterOptio
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down
1 change: 0 additions & 1 deletion pkg/object/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ func (repo PostgresRepository) List(ctx context.Context, filterOptions *FilterOp
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down
1 change: 0 additions & 1 deletion pkg/object/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ func (repo SQLiteRepository) List(ctx context.Context, filterOptions *FilterOpti
i++
}

//nolint:gosec
firstElem := models[0]
lastElem := models[len(models)-1]
var firstValue interface{} = nil
Expand Down

0 comments on commit 59c5e2b

Please sign in to comment.