Skip to content

Commit f6b70ec

Browse files
Pin golangci-lint to v2.4.0 (#754)
1 parent e1d040f commit f6b70ec

22 files changed

+123
-116
lines changed

.github/workflows/pr_test.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
on:
1+
on:
22
pull_request:
33
types:
44
- opened
@@ -14,7 +14,7 @@ jobs:
1414
if: github.actor != 'dependabot[bot]'
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: dangoslen/changelog-enforcer@v3
17+
- uses: dangoslen/changelog-enforcer@v3
1818
golangci:
1919
name: lint
2020
runs-on: ubuntu-latest
@@ -26,20 +26,20 @@ jobs:
2626
- name: golangci-lint
2727
uses: golangci/golangci-lint-action@v8
2828
with:
29-
version: v2.1
29+
version: v2.4.0
3030
test:
3131
strategy:
3232
matrix:
3333
go-version: [1.24.x]
3434
platform: [ubuntu-latest]
3535
runs-on: ${{ matrix.platform }}
3636
steps:
37-
- name: Checkout code
38-
uses: actions/checkout@v5
39-
- name: Install Go
40-
uses: actions/setup-go@v6
41-
with:
42-
go-version: ${{ matrix.go-version }}
43-
- name: Test
44-
run: make test
45-
shell: bash
37+
- name: Checkout code
38+
uses: actions/checkout@v5
39+
- name: Install Go
40+
uses: actions/setup-go@v6
41+
with:
42+
go-version: ${{ matrix.go-version }}
43+
- name: Test
44+
run: make test
45+
shell: bash

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@
55
[Full Changelog](https://github.com/fastly/go-fastly/compare/v11.2.0...)
66

77
### Breaking:
8-
- breaking(ngwaf/rules): group and multival conditions no longer accept a 'type' field
8+
9+
- breaking(ngwaf/rules): group and multival conditions no longer accept a 'type' field ([#755](https://github.com/fastly/go-fastly/pull/755))
10+
- breaking(ngwaf): rename package `common` to `scope` and `ScopeType` to just `Type` ([#754](https://github.com/fastly/go-fastly/pull/754))
911

1012
### Enhancements:
13+
1114
- feat(ngwaf/rules): add support for the multival condition type ([#755](https://github.com/fastly/go-fastly/pull/755))
15+
1216
### Bug fixes:
1317

1418
### Dependencies:
19+
1520
- build(deps): `golang.org/x/crypto` from 0.41.0 to 0.42.0 ([#751](https://github.com/fastly/go-fastly/pull/751))
1621
- build(deps): `golang.org/x/sys` from 0.35.0 to 0.36.0 ([#751](https://github.com/fastly/go-fastly/pull/751))
1722
- build(deps): `actions/setup-go` from 5 to 6 ([#752](https://github.com/fastly/go-fastly/pull/752))
@@ -21,9 +26,11 @@
2126
[Full Changelog](https://github.com/fastly/go-fastly/compare/v11.3.0...v11.3.1)
2227

2328
### Bug fixes:
29+
2430
- fix(logging): Add CompressionCodec and GZipLevel to HTTPS update struct
2531

2632
### Dependencies:
33+
2734
- build(deps): `golang.org/x/crypto` from 0.40.0 to 0.41.0 ([#740](https://github.com/fastly/go-fastly/pull/740))
2835
- build(deps): `golang.org/x/sys` from 0.34.0 to 0.35.0 ([#740](https://github.com/fastly/go-fastly/pull/740))
2936
- build(deps): `github.com/stretchr/testify` from 1.10.0 to 1.11.0 ([#742](https://github.com/fastly/go-fastly/pull/742))

fastly/ngwaf/v1/lists/api_create.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77

88
"github.com/fastly/go-fastly/v11/fastly"
9-
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/common"
9+
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/scope"
1010
)
1111

1212
// CreateInput specifies the information needed for the Create()
@@ -20,7 +20,7 @@ type CreateInput struct {
2020
Name *string `json:"name"`
2121
// Scope defines where the list is located, including its type (e.g.,
2222
// "workspace" or "account") and the specific IDs it applies to (required).
23-
Scope *common.Scope `json:"-"`
23+
Scope *scope.Scope `json:"-"`
2424
// Type is the type of the list. Must be one of `string` |
2525
// `wildcard` | `ip` | `country` | `signal` (required).
2626
Type *string `json:"type"`
@@ -41,7 +41,7 @@ func Create(ctx context.Context, c *fastly.Client, i *CreateInput) (*List, error
4141
return nil, fastly.ErrMissingScope
4242
}
4343

44-
path, err := common.BuildPath(i.Scope, "lists", "")
44+
path, err := scope.BuildPath(i.Scope, "lists", "")
4545
if err != nil {
4646
return nil, fmt.Errorf("failed to build API path: %w", err)
4747
}

fastly/ngwaf/v1/lists/api_delete.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"net/http"
77

88
"github.com/fastly/go-fastly/v11/fastly"
9-
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/common"
9+
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/scope"
1010
)
1111

1212
// DeleteInput specifies the information needed for the Delete()
@@ -16,7 +16,7 @@ type DeleteInput struct {
1616
ListID *string
1717
// Scope defines where the list is applied, including its type (e.g.,
1818
// "workspace" or "account") and the specific IDs it applies to (required).
19-
Scope *common.Scope
19+
Scope *scope.Scope
2020
}
2121

2222
// Delete deletes the specified list.
@@ -28,7 +28,7 @@ func Delete(ctx context.Context, c *fastly.Client, i *DeleteInput) error {
2828
return fastly.ErrMissingScope
2929
}
3030

31-
path, err := common.BuildPath(i.Scope, "lists", *i.ListID)
31+
path, err := scope.BuildPath(i.Scope, "lists", *i.ListID)
3232
if err != nil {
3333
return fmt.Errorf("failed to build API path: %w", err)
3434
}

fastly/ngwaf/v1/lists/api_get.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77

88
"github.com/fastly/go-fastly/v11/fastly"
9-
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/common"
9+
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/scope"
1010
)
1111

1212
// GetInput specifies the information needed for the Get() function to
@@ -16,7 +16,7 @@ type GetInput struct {
1616
ListID *string
1717
// Scope defines where the list is applied, including its type (e.g.,
1818
// "workspace" or "account") and the specific IDs it applies to (required).
19-
Scope *common.Scope
19+
Scope *scope.Scope
2020
}
2121

2222
// Get retrieves the specified list.
@@ -28,7 +28,7 @@ func Get(ctx context.Context, c *fastly.Client, i *GetInput) (*List, error) {
2828
return nil, fastly.ErrMissingScope
2929
}
3030

31-
path, err := common.BuildPath(i.Scope, "lists", *i.ListID)
31+
path, err := scope.BuildPath(i.Scope, "lists", *i.ListID)
3232
if err != nil {
3333
return nil, fmt.Errorf("failed to build API path: %w", err)
3434
}

fastly/ngwaf/v1/lists/api_list.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import (
66
"fmt"
77

88
"github.com/fastly/go-fastly/v11/fastly"
9-
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/common"
9+
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/scope"
1010
)
1111

1212
// ListInput specifies the information needed for the List() function to perform
1313
// the operation.
1414
type ListInput struct {
1515
// Scope defines where the list is located, including its type (e.g.,
1616
// "workspace" or "account") and the specific IDs it applies to (required).
17-
Scope *common.Scope
17+
Scope *scope.Scope
1818
}
1919

2020
// ListLists retrieves a list of lists for the given workspace.
@@ -23,7 +23,7 @@ func ListLists(ctx context.Context, c *fastly.Client, i *ListInput) (*Lists, err
2323
return nil, fastly.ErrMissingScope
2424
}
2525

26-
path, err := common.BuildPath(i.Scope, "lists", "")
26+
path, err := scope.BuildPath(i.Scope, "lists", "")
2727
if err != nil {
2828
return nil, fmt.Errorf("failed to build API path: %w", err)
2929
}

fastly/ngwaf/v1/lists/api_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"testing"
99

1010
"github.com/fastly/go-fastly/v11/fastly"
11-
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/common"
11+
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/scope"
1212
)
1313

1414
const (
@@ -20,14 +20,14 @@ const (
2020
)
2121

2222
func TestClient_Lists_WorkspaceScope(t *testing.T) {
23-
runListsTest(t, common.ScopeTypeWorkspace, fastly.TestNGWAFWorkspaceID)
23+
runListsTest(t, scope.ScopeTypeWorkspace, fastly.TestNGWAFWorkspaceID)
2424
}
2525

2626
func TestClient_Lists_AccountScope(t *testing.T) {
27-
runListsTest(t, common.ScopeTypeAccount, "*") // assuming TestNGWAFAccountID exists
27+
runListsTest(t, scope.ScopeTypeAccount, "*") // assuming TestNGWAFAccountID exists
2828
}
2929

30-
func runListsTest(t *testing.T, scopeType common.ScopeType, appliesToID string) {
30+
func runListsTest(t *testing.T, scopeType scope.Type, appliesToID string) {
3131
var err error
3232
listEntries := []string{listEntry}
3333
testListName := listName + string(scopeType)
@@ -40,7 +40,7 @@ func runListsTest(t *testing.T, scopeType common.ScopeType, appliesToID string)
4040
Description: fastly.ToPointer(listDescription),
4141
Entries: fastly.ToPointer(listEntries),
4242
Name: fastly.ToPointer(testListName),
43-
Scope: &common.Scope{
43+
Scope: &scope.Scope{
4444
Type: scopeType,
4545
AppliesTo: []string{appliesToID},
4646
},
@@ -77,7 +77,7 @@ func runListsTest(t *testing.T, scopeType common.ScopeType, appliesToID string)
7777
fastly.Record(t, fmt.Sprintf("%s_delete_list", scopeType), func(c *fastly.Client) {
7878
err = Delete(context.TODO(), c, &DeleteInput{
7979
ListID: fastly.ToPointer(list.ListID),
80-
Scope: &common.Scope{
80+
Scope: &scope.Scope{
8181
Type: scopeType,
8282
AppliesTo: []string{appliesToID},
8383
},
@@ -93,7 +93,7 @@ func runListsTest(t *testing.T, scopeType common.ScopeType, appliesToID string)
9393
fastly.Record(t, fmt.Sprintf("%s_get_list", scopeType), func(c *fastly.Client) {
9494
getList, err = Get(context.TODO(), c, &GetInput{
9595
ListID: fastly.ToPointer(list.ListID),
96-
Scope: &common.Scope{
96+
Scope: &scope.Scope{
9797
Type: scopeType,
9898
AppliesTo: []string{appliesToID},
9999
},
@@ -136,7 +136,7 @@ func runListsTest(t *testing.T, scopeType common.ScopeType, appliesToID string)
136136
Description: fastly.ToPointer(updateListDescription),
137137
Entries: fastly.ToPointer(updateListEntries),
138138
ListID: fastly.ToPointer(list.ListID),
139-
Scope: &common.Scope{
139+
Scope: &scope.Scope{
140140
Type: scopeType,
141141
AppliesTo: []string{appliesToID},
142142
},
@@ -172,7 +172,7 @@ func runListsTest(t *testing.T, scopeType common.ScopeType, appliesToID string)
172172
// List all lists.
173173
fastly.Record(t, fmt.Sprintf("%s_list_lists", scopeType), func(c *fastly.Client) {
174174
lists, err = ListLists(context.TODO(), c, &ListInput{
175-
Scope: &common.Scope{
175+
Scope: &scope.Scope{
176176
Type: scopeType,
177177
AppliesTo: []string{appliesToID},
178178
},

fastly/ngwaf/v1/lists/api_update.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77

88
"github.com/fastly/go-fastly/v11/fastly"
9-
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/common"
9+
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/scope"
1010
)
1111

1212
// UpdateInput specifies the information needed for the Update()
@@ -20,7 +20,7 @@ type UpdateInput struct {
2020
ListID *string
2121
// Scope defines where the list is located, including its type (e.g.,
2222
// "workspace" or "account") and the specific IDs it applies to (required).
23-
Scope *common.Scope
23+
Scope *scope.Scope
2424
}
2525

2626
// Update updates the specified list.
@@ -29,7 +29,7 @@ func Update(ctx context.Context, c *fastly.Client, i *UpdateInput) (*List, error
2929
return nil, fastly.ErrMissingListID
3030
}
3131

32-
path, err := common.BuildPath(i.Scope, "lists", *i.ListID)
32+
path, err := scope.BuildPath(i.Scope, "lists", *i.ListID)
3333
if err != nil {
3434
return nil, fmt.Errorf("failed to build API path: %w", err)
3535
}

fastly/ngwaf/v1/rules/api_create.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"time"
88

99
"github.com/fastly/go-fastly/v11/fastly"
10-
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/common"
10+
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/scope"
1111
)
1212

1313
// CreateInput specifies the information needed for the Create()
@@ -46,7 +46,7 @@ type CreateInput struct {
4646
// Scope defines where the rule is applied, including its type
4747
// (e.g., "workspace" or "account") and the specific IDs it
4848
// applies to (required).
49-
Scope *common.Scope
49+
Scope *scope.Scope
5050
// Type specifies the category of the rule (e.g., "request")
5151
// (required).
5252
Type *string
@@ -253,7 +253,7 @@ func Create(ctx context.Context, c *fastly.Client, i *CreateInput) (*Rule, error
253253
GroupOperator *string `json:"group_operator,omitempty"`
254254
RateLimit *CreateRateLimit `json:"rate_limit,omitempty"`
255255
RequestLogging *string `json:"request_logging,omitempty"`
256-
Scope *common.Scope `json:"scope"`
256+
Scope *scope.Scope `json:"scope"`
257257
Type *string `json:"type"`
258258
}{
259259
Actions: i.Actions,
@@ -268,7 +268,7 @@ func Create(ctx context.Context, c *fastly.Client, i *CreateInput) (*Rule, error
268268
Type: i.Type,
269269
}
270270

271-
path, err := common.BuildPath(i.Scope, "rules", "")
271+
path, err := scope.BuildPath(i.Scope, "rules", "")
272272
if err != nil {
273273
return nil, fmt.Errorf("failed to build API path: %w", err)
274274
}

fastly/ngwaf/v1/rules/api_delete.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"net/http"
77

88
"github.com/fastly/go-fastly/v11/fastly"
9-
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/common"
9+
"github.com/fastly/go-fastly/v11/fastly/ngwaf/v1/scope"
1010
)
1111

1212
// DeleteInput specifies the information needed for the Delete()
@@ -17,7 +17,7 @@ type DeleteInput struct {
1717
// Scope defines where the rule is applied, including its
1818
// type (e.g., "workspace" or "account") and the specific
1919
// IDs it applies to (required).
20-
Scope *common.Scope
20+
Scope *scope.Scope
2121
}
2222

2323
// Delete deletes the specified rule.
@@ -29,7 +29,7 @@ func Delete(ctx context.Context, c *fastly.Client, i *DeleteInput) error {
2929
return fastly.ErrMissingScope
3030
}
3131

32-
path, err := common.BuildPath(i.Scope, "rules", *i.RuleID)
32+
path, err := scope.BuildPath(i.Scope, "rules", *i.RuleID)
3333
if err != nil {
3434
return fmt.Errorf("failed to build API path: %w", err)
3535
}

0 commit comments

Comments
 (0)