Skip to content

Commit 000de8e

Browse files
committed
fix golangci-lint
1 parent ce786e2 commit 000de8e

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

internal/services/baremetal/helper_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,5 @@ func IsOfferAvailable(offerID string, zone scw.Zone, tt *acctest.TestTools) bool
1212
Zone: zone,
1313
OfferID: offerID,
1414
})
15-
if offer.Stock == baremetal.OfferStockAvailable {
16-
return true
17-
}
18-
return false
15+
return offer.Stock == baremetal.OfferStockAvailable
1916
}

internal/services/baremetal/offer_data_source_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ import (
1616
const (
1717
OfferName = "EM-B220E-NVME"
1818
Region = "fr-par-1"
19-
OfferId = "206ea234-9097-4ae1-af68-6d2be09f47ed"
19+
OfferID = "206ea234-9097-4ae1-af68-6d2be09f47ed"
2020
)
2121

2222
func TestAccDataSourceOffer_Basic(t *testing.T) {
2323
tt := acctest.NewTestTools(t)
2424
defer tt.Cleanup()
25-
if !IsOfferAvailable(OfferId, Region, tt) {
25+
if !IsOfferAvailable(OfferID, Region, tt) {
2626
t.Skip("Offer is out of stock")
2727
}
2828
resource.ParallelTest(t, resource.TestCase{
@@ -47,7 +47,7 @@ func TestAccDataSourceOffer_Basic(t *testing.T) {
4747
resource.TestCheckResourceAttrPair("data.scaleway_baremetal_offer.test2", "offer_id", "data.scaleway_baremetal_offer.test1", "offer_id"),
4848
resource.TestCheckResourceAttr("data.scaleway_baremetal_offer.test2", "name", OfferName),
4949
resource.TestCheckResourceAttr("data.scaleway_baremetal_offer.test2", "commercial_range", "beryllium"),
50-
resource.TestCheckResourceAttr("data.scaleway_baremetal_offer.test2", "include_disabled", "false"), //what the hell
50+
resource.TestCheckResourceAttr("data.scaleway_baremetal_offer.test2", "include_disabled", "false"),
5151
resource.TestCheckResourceAttr("data.scaleway_baremetal_offer.test2", "bandwidth", "1000000000"),
5252
resource.TestCheckResourceAttr("data.scaleway_baremetal_offer.test2", "commercial_range", "beryllium"),
5353
resource.TestCheckResourceAttr("data.scaleway_baremetal_offer.test2", "stock", "available"), // skipping this as stocks vary too much
@@ -72,7 +72,7 @@ func TestAccDataSourceOffer_Basic(t *testing.T) {
7272
func TestAccDataSourceOffer_SubscriptionPeriodHourly(t *testing.T) {
7373
tt := acctest.NewTestTools(t)
7474
defer tt.Cleanup()
75-
if !IsOfferAvailable(OfferId, Region, tt) {
75+
if !IsOfferAvailable(OfferID, Region, tt) {
7676
t.Skip("Offer is out of stock")
7777
}
7878
resource.ParallelTest(t, resource.TestCase{
@@ -126,7 +126,7 @@ func TestAccDataSourceOffer_SubscriptionPeriodHourly(t *testing.T) {
126126
func TestAccDataSourceOffer_SubscriptionPeriodMonthly(t *testing.T) {
127127
tt := acctest.NewTestTools(t)
128128
defer tt.Cleanup()
129-
if !IsOfferAvailable(OfferId, Region, tt) {
129+
if !IsOfferAvailable(OfferID, Region, tt) {
130130
t.Skip("Offer is out of stock")
131131
}
132132
resource.ParallelTest(t, resource.TestCase{

internal/services/baremetal/server_data_source_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
func TestAccDataSourceServer_Basic(t *testing.T) {
1313
tt := acctest.NewTestTools(t)
1414
defer tt.Cleanup()
15-
if !IsOfferAvailable(OfferId, Region, tt) {
15+
if !IsOfferAvailable(OfferID, Region, tt) {
1616
t.Skip("Offer is out of stock")
1717
}
1818

internal/services/baremetal/server_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestAccServer_Basic(t *testing.T) {
2020
// t.Skip("Skipping Baremetal Server test as no stock is available currently")
2121
tt := acctest.NewTestTools(t)
2222
defer tt.Cleanup()
23-
if !IsOfferAvailable(OfferId, Region, tt) {
23+
if !IsOfferAvailable(OfferID, Region, tt) {
2424
t.Skip("Offer is out of stock")
2525
}
2626

@@ -114,7 +114,7 @@ func TestAccServer_Basic(t *testing.T) {
114114
func TestAccServer_RequiredInstallConfig(t *testing.T) {
115115
tt := acctest.NewTestTools(t)
116116
defer tt.Cleanup()
117-
if !IsOfferAvailable(OfferId, Region, tt) {
117+
if !IsOfferAvailable(OfferID, Region, tt) {
118118
t.Skip("Offer is out of stock")
119119
}
120120

@@ -175,7 +175,7 @@ func TestAccServer_WithoutInstallConfig(t *testing.T) {
175175
func TestAccServer_CreateServerWithOption(t *testing.T) {
176176
tt := acctest.NewTestTools(t)
177177
defer tt.Cleanup()
178-
if !IsOfferAvailable(OfferId, Region, tt) {
178+
if !IsOfferAvailable(OfferID, Region, tt) {
179179
t.Skip("Offer is out of stock")
180180
}
181181

@@ -240,7 +240,7 @@ func TestAccServer_CreateServerWithOption(t *testing.T) {
240240
func TestAccServer_AddOption(t *testing.T) {
241241
tt := acctest.NewTestTools(t)
242242
defer tt.Cleanup()
243-
if !IsOfferAvailable(OfferId, Region, tt) {
243+
if !IsOfferAvailable(OfferID, Region, tt) {
244244
t.Skip("Offer is out of stock")
245245
}
246246

@@ -331,7 +331,7 @@ func TestAccServer_AddOption(t *testing.T) {
331331
func TestAccServer_AddTwoOptionsThenDeleteOne(t *testing.T) {
332332
tt := acctest.NewTestTools(t)
333333
defer tt.Cleanup()
334-
if !IsOfferAvailable(OfferId, Region, tt) {
334+
if !IsOfferAvailable(OfferID, Region, tt) {
335335
t.Skip("Offer is out of stock")
336336
}
337337

@@ -485,7 +485,7 @@ func TestAccServer_AddTwoOptionsThenDeleteOne(t *testing.T) {
485485
func TestAccServer_CreateServerWithPrivateNetwork(t *testing.T) {
486486
tt := acctest.NewTestTools(t)
487487
defer tt.Cleanup()
488-
if !IsOfferAvailable(OfferId, Region, tt) {
488+
if !IsOfferAvailable(OfferID, Region, tt) {
489489
t.Skip("Offer is out of stock")
490490
}
491491

@@ -554,7 +554,7 @@ func TestAccServer_CreateServerWithPrivateNetwork(t *testing.T) {
554554
func TestAccServer_AddPrivateNetwork(t *testing.T) {
555555
tt := acctest.NewTestTools(t)
556556
defer tt.Cleanup()
557-
if !IsOfferAvailable(OfferId, Region, tt) {
557+
if !IsOfferAvailable(OfferID, Region, tt) {
558558
t.Skip("Offer is out of stock")
559559
}
560560

@@ -666,7 +666,7 @@ func TestAccServer_AddPrivateNetwork(t *testing.T) {
666666
func TestAccServer_AddAnotherPrivateNetwork(t *testing.T) {
667667
tt := acctest.NewTestTools(t)
668668
defer tt.Cleanup()
669-
if !IsOfferAvailable(OfferId, Region, tt) {
669+
if !IsOfferAvailable(OfferID, Region, tt) {
670670
t.Skip("Offer is out of stock")
671671
}
672672

@@ -791,7 +791,7 @@ func TestAccServer_AddAnotherPrivateNetwork(t *testing.T) {
791791
func TestAccServer_WithIPAMPrivateNetwork(t *testing.T) {
792792
tt := acctest.NewTestTools(t)
793793
defer tt.Cleanup()
794-
if !IsOfferAvailable(OfferId, Region, tt) {
794+
if !IsOfferAvailable(OfferID, Region, tt) {
795795
t.Skip("Offer is out of stock")
796796
}
797797

0 commit comments

Comments
 (0)