Skip to content

Commit f0d3db5

Browse files
committed
Fixes and Makefile
1 parent b63a9dd commit f0d3db5

6 files changed

Lines changed: 19 additions & 16 deletions

File tree

internal/productcore/base.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ type EnablementStatus struct {
4848
// used by unit tests to provide mock behaviors
4949
type EnablementHookFuncs[O any] struct {
5050
DisableFunc func(api.Interface, string) error
51-
EnableFunc func(api.Interface, string) (O, error)
52-
GetFunc func(api.Interface, string) (O, error)
51+
EnableFunc func(api.Interface, string) (O, error)
52+
GetFunc func(api.Interface, string) (O, error)
5353
}
5454

5555
// ConfigurationHookFuncs is a structure of dependency-injection
5656
// points used by unit tests to provide mock behaviors
5757
type ConfigurationHookFuncs[O, I any] struct {
58-
GetConfigurationFunc func(api.Interface, string) (O, error)
58+
GetConfigurationFunc func(api.Interface, string) (O, error)
5959
UpdateConfigurationFunc func(api.Interface, string, I) (O, error)
6060
}

internal/productcore/disable.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package productcore
22

33
import (
44
"io"
5+
56
fsterr "github.com/fastly/cli/pkg/errors"
67

78
"github.com/fastly/cli/pkg/argparser"

internal/productcore/enable.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ package productcore
22

33
import (
44
"io"
5-
fsterr "github.com/fastly/cli/pkg/errors"
5+
66
"github.com/fastly/cli/pkg/argparser"
7+
fsterr "github.com/fastly/cli/pkg/errors"
78
"github.com/fastly/cli/pkg/global"
89
"github.com/fastly/cli/pkg/text"
910
)

internal/productcore/status.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package productcore
22

33
import (
4-
"io"
54
"errors"
6-
"github.com/fastly/go-fastly/v9/fastly"
7-
fsterr "github.com/fastly/cli/pkg/errors"
5+
"io"
6+
87
"github.com/fastly/cli/pkg/argparser"
8+
fsterr "github.com/fastly/cli/pkg/errors"
99
"github.com/fastly/cli/pkg/global"
1010
"github.com/fastly/cli/pkg/text"
11+
"github.com/fastly/go-fastly/v9/fastly"
1112
)
1213

1314
// Status is a base type for all 'status' commands.

internal/productcore_test/enablement.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import (
1212
)
1313

1414
type TestEnablementInput[O any] struct {
15-
T *testing.T
16-
Commands []string
15+
T *testing.T
16+
Commands []string
1717
ProductName string
18-
Hooks *productcore.EnablementHookFuncs[O]
18+
Hooks *productcore.EnablementHookFuncs[O]
1919
}
2020

2121
func TestEnablement[O any](i TestEnablementInput[O]) {
@@ -137,7 +137,7 @@ func TestEnablement[O any](i TestEnablementInput[O]) {
137137
i.Hooks.GetFunc = func(_ api.Interface, _ string) (o O, err error) {
138138
// The API returns a 'Bad Request' error when the
139139
// product has not been enabled on the service
140-
err = &fastly.HTTPError{StatusCode: 400}
140+
err = &fastly.HTTPError{StatusCode: 400}
141141
return
142142
}
143143
},
@@ -150,7 +150,7 @@ func TestEnablement[O any](i TestEnablementInput[O]) {
150150
i.Hooks.GetFunc = func(_ api.Interface, _ string) (o O, err error) {
151151
// The API returns a 'Bad Request' error when the
152152
// product has not been enabled on the service
153-
err = &fastly.HTTPError{StatusCode: 400}
153+
err = &fastly.HTTPError{StatusCode: 400}
154154
return
155155
}
156156
},

pkg/commands/product/botmanagement/product_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ package botmanagement_test
33
import (
44
"testing"
55

6-
"github.com/fastly/go-fastly/v9/fastly/products/botmanagement"
76
"github.com/fastly/cli/internal/productcore_test"
87
root "github.com/fastly/cli/pkg/commands/product"
98
sub "github.com/fastly/cli/pkg/commands/product/botmanagement"
9+
"github.com/fastly/go-fastly/v9/fastly/products/botmanagement"
1010
)
1111

1212
func TestProductEnablement(t *testing.T) {
1313
productcore_test.TestEnablement(productcore_test.TestEnablementInput[*botmanagement.EnableOutput]{
14-
T: t,
15-
Commands: []string{root.CommandName, sub.CommandName},
14+
T: t,
15+
Commands: []string{root.CommandName, sub.CommandName},
1616
ProductName: botmanagement.ProductName,
17-
Hooks: &sub.EnablementHooks,
17+
Hooks: &sub.EnablementHooks,
1818
})
1919
}

0 commit comments

Comments
 (0)