Skip to content

Commit 7b94c22

Browse files
committed
Fix lint errors
1 parent 157e989 commit 7b94c22

15 files changed

+29
-15
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ linters:
2626
- predeclared
2727
- revive
2828
- staticcheck
29-
- tenv
29+
- usetesting
3030
- unconvert
3131
- unparam
3232
- unused

internal/provider/destination_filter_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package provider
33
import (
44
"context"
55
"fmt"
6+
"net/http"
67
"regexp"
78
"strings"
89

@@ -201,7 +202,7 @@ func (r *destinationFilterResource) Read(ctx context.Context, req resource.ReadR
201202
defer body.Body.Close()
202203
}
203204
if err != nil {
204-
if body.StatusCode == 404 {
205+
if body.StatusCode == http.StatusNotFound {
205206
resp.State.RemoveResource(ctx)
206207

207208
return

internal/provider/destination_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package provider
33
import (
44
"context"
55
"fmt"
6+
"net/http"
67

78
"github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier"
89
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier"
@@ -587,7 +588,7 @@ func (r *destinationResource) Read(ctx context.Context, req resource.ReadRequest
587588
defer body.Body.Close()
588589
}
589590
if err != nil {
590-
if body.StatusCode == 404 {
591+
if body.StatusCode == http.StatusNotFound {
591592
resp.State.RemoveResource(ctx)
592593

593594
return

internal/provider/destination_subscription_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"net/http"
78
"strings"
89

910
"github.com/segmentio/terraform-provider-segment/internal/provider/docs"
@@ -228,7 +229,7 @@ func (r *destinationSubscriptionResource) Read(ctx context.Context, req resource
228229
defer body.Body.Close()
229230
}
230231
if err != nil {
231-
if body.StatusCode == 404 {
232+
if body.StatusCode == http.StatusNotFound {
232233
resp.State.RemoveResource(ctx)
233234

234235
return

internal/provider/function_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package provider
33
import (
44
"context"
55
"fmt"
6+
"net/http"
67
"regexp"
78

89
"github.com/segmentio/terraform-provider-segment/internal/provider/docs"
@@ -189,7 +190,7 @@ func (r *functionResource) Read(ctx context.Context, req resource.ReadRequest, r
189190
defer body.Body.Close()
190191
}
191192
if err != nil {
192-
if body.StatusCode == 404 {
193+
if body.StatusCode == http.StatusNotFound {
193194
resp.State.RemoveResource(ctx)
194195

195196
return

internal/provider/insert_function_instance_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package provider
33
import (
44
"context"
55
"fmt"
6+
"net/http"
67
"strings"
78

89
"github.com/segmentio/terraform-provider-segment/internal/provider/docs"
@@ -159,7 +160,7 @@ func (r *insertFunctionInstanceResource) Read(ctx context.Context, req resource.
159160
defer body.Body.Close()
160161
}
161162
if err != nil {
162-
if body.StatusCode == 404 {
163+
if body.StatusCode == http.StatusNotFound {
163164
resp.State.RemoveResource(ctx)
164165

165166
return

internal/provider/reverse_etl_model_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package provider
33
import (
44
"context"
55
"fmt"
6+
"net/http"
67

78
"github.com/segmentio/terraform-provider-segment/internal/provider/docs"
89
"github.com/segmentio/terraform-provider-segment/internal/provider/models"
@@ -160,7 +161,7 @@ func (r *reverseETLModelResource) Read(ctx context.Context, req resource.ReadReq
160161
defer body.Body.Close()
161162
}
162163
if err != nil {
163-
if body.StatusCode == 404 {
164+
if body.StatusCode == http.StatusNotFound {
164165
resp.State.RemoveResource(ctx)
165166

166167
return

internal/provider/source_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package provider
33
import (
44
"context"
55
"fmt"
6+
"net/http"
67

78
"github.com/hashicorp/terraform-plugin-framework-validators/setvalidator"
89
"github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier"
@@ -387,7 +388,7 @@ func (r *sourceResource) Read(ctx context.Context, req resource.ReadRequest, res
387388
defer body.Body.Close()
388389
}
389390
if err != nil {
390-
if body.StatusCode == 404 {
391+
if body.StatusCode == http.StatusNotFound {
391392
resp.State.RemoveResource(ctx)
392393

393394
return

internal/provider/source_tracking_plan_connection_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
"net/http"
78
"strings"
89

910
"github.com/avast/retry-go/v4"
@@ -255,7 +256,7 @@ func (r *sourceTrackingPlanConnectionResource) Read(ctx context.Context, req res
255256
defer body.Body.Close()
256257
}
257258
if err != nil {
258-
if body.StatusCode == 404 {
259+
if body.StatusCode == http.StatusNotFound {
259260
resp.State.RemoveResource(ctx)
260261

261262
return

internal/provider/source_warehouse_connection_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package provider
33
import (
44
"context"
55
"fmt"
6+
"net/http"
67

78
"github.com/hashicorp/terraform-plugin-framework/resource"
89
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
@@ -126,7 +127,7 @@ func (r *sourceWarehouseConnectionResource) Read(ctx context.Context, req resour
126127
defer body.Body.Close()
127128
}
128129
if err != nil {
129-
if body.StatusCode == 404 {
130+
if body.StatusCode == http.StatusNotFound {
130131
resp.State.RemoveResource(ctx)
131132

132133
return

0 commit comments

Comments
 (0)