Skip to content

Commit

Permalink
Fix lint (#320)
Browse files Browse the repository at this point in the history
* Remove deprecated linters

* Fix some lint errors

* Upgrade docker image

* Disable unused-parameter linter

* Fix lint and add unused-parameter rule back
  • Loading branch information
zliang-akamai authored Apr 21, 2023
1 parent f2f64e5 commit 92acbec
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ linters-settings:
linters:
enable-all: true
disable:
# deprecated linters
- deadcode
- ifshort
- varcheck
- nosnakecase
####################

- bodyclose
- contextcheck
- nilerr
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TEST_TIMEOUT := 5h

SKIP_DOCKER ?= 0
GOLANGCILINT := golangci-lint
GOLANGCILINT_IMG := golangci/golangci-lint:v1.46.2-alpine
GOLANGCILINT_IMG := golangci/golangci-lint:latest
GOLANGCILINT_ARGS := run

LINODE_URL := https://api.linode.com/
Expand Down
4 changes: 2 additions & 2 deletions databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (c *Client) ListDatabaseEngines(ctx context.Context, opts *ListOptions) ([]
}

// GetDatabaseEngine returns a specific Database Engine. This endpoint is cached by default.
func (c *Client) GetDatabaseEngine(ctx context.Context, opts *ListOptions, engineID string) (*DatabaseEngine, error) {
func (c *Client) GetDatabaseEngine(ctx context.Context, _ *ListOptions, engineID string) (*DatabaseEngine, error) {
e := fmt.Sprintf("databases/engines/%s", engineID)

if result := c.getCachedResponse(e); result != nil {
Expand Down Expand Up @@ -279,7 +279,7 @@ func (c *Client) ListDatabaseTypes(ctx context.Context, opts *ListOptions) ([]Da
}

// GetDatabaseType returns a specific Database Type. This endpoint is cached by default.
func (c *Client) GetDatabaseType(ctx context.Context, opts *ListOptions, typeID string) (*DatabaseType, error) {
func (c *Client) GetDatabaseType(ctx context.Context, _ *ListOptions, typeID string) (*DatabaseType, error) {
e := fmt.Sprintf("databases/types/%s", typeID)

if result := c.getCachedResponse(e); result != nil {
Expand Down
4 changes: 2 additions & 2 deletions pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ type PageOptions struct {
// ListOptions are the pagination and filtering (TODO) parameters for endpoints
type ListOptions struct {
*PageOptions
PageSize int
Filter string
PageSize int `json:"page_size"`
Filter string `json:"filter"`
}

// NewListOptions simplified construction of ListOptions using only
Expand Down
2 changes: 1 addition & 1 deletion waitfor.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (client Client) WaitForLKEClusterConditions(
// WaitForEventFinished waits for an entity action to reach the 'finished' state
// before returning. It will timeout with an error after timeoutSeconds.
// If the event indicates a failure both the failed event and the error will be returned.
// nolint
//nolint
func (client Client) WaitForEventFinished(ctx context.Context, id any, entityType EntityType, action EventAction, minStart time.Time, timeoutSeconds int) (*Event, error) {
titledEntityType := strings.Title(string(entityType))
filter := Filter{
Expand Down

0 comments on commit 92acbec

Please sign in to comment.