Skip to content

Commit

Permalink
Fix some linting warnings (plus future use of staticcheck?) (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
c9845 authored Aug 18, 2023
1 parent d54f22b commit d5d643a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 20 deletions.
7 changes: 0 additions & 7 deletions asset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ import (
"github.com/jarcoal/httpmock"
)

func assetTests(t *testing.T, asset Asset) {
expectedKey := "templates/index.liquid"
if asset.Key != expectedKey {
t.Errorf("Asset.Key returned %+v, expected %+v", asset.Key, expectedKey)
}
}

func TestAssetList(t *testing.T) {
setup()
defer teardown()
Expand Down
2 changes: 0 additions & 2 deletions customer_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package goshopify

import "fmt"

const customerAddressResourceName = "customer-addresses"

// CustomerAddressService is an interface for interfacing with the customer address endpoints
// of the Shopify API.
// See: https://help.shopify.com/en/api/reference/customers/customer_address
Expand Down
2 changes: 1 addition & 1 deletion draft_order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestDraftOrderCreate(t *testing.T) {

draftOrder := DraftOrder{
LineItems: []LineItem{
LineItem{
{
VariantID: 1,
Quantity: 1,
},
Expand Down
4 changes: 2 additions & 2 deletions goshopify.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ func (c *Client) NewRequest(method, relPath string, body, options interface{}) (
// token. The shopName parameter is the shop's myshopify domain,
// e.g. "theshop.myshopify.com", or simply "theshop"
// a.NewClient(shopName, token, opts) is equivalent to NewClient(a, shopName, token, opts)
func (a App) NewClient(shopName, token string, opts ...Option) *Client {
return NewClient(a, shopName, token, opts...)
func (app App) NewClient(shopName, token string, opts ...Option) *Client {
return NewClient(app, shopName, token, opts...)
}

// Returns a new Shopify API client with an already authenticated shopname and
Expand Down
2 changes: 1 addition & 1 deletion logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestDoGetHeadersDebug(t *testing.T) {
client.logResponse(&http.Response{
Status: http.StatusText(http.StatusOK),
StatusCode: http.StatusOK,
Header: map[string][]string{"X-Request-Id": []string{"00000000-0000-0000-0000-000000000000"}},
Header: map[string][]string{"X-Request-Id": {"00000000-0000-0000-0000-000000000000"}},
Body: ioutil.NopCloser(strings.NewReader("response body")),
})

Expand Down
12 changes: 6 additions & 6 deletions order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func TestOrderCreate(t *testing.T) {

order := Order{
LineItems: []LineItem{
LineItem{
{
VariantID: 1,
Quantity: 1,
},
Expand Down Expand Up @@ -1173,7 +1173,7 @@ func propertiesEmptyStructLientItem() LineItem {
func propertiesStructLientItem() LineItem {
return LineItem{
Properties: []NoteAttribute{
NoteAttribute{
{
Name: "property 1",
Value: float64(3),
},
Expand Down Expand Up @@ -1209,11 +1209,11 @@ func validLineItem() LineItem {
VariantInventoryManagement: "shopify",
PreTaxPrice: &preTaxPrice,
Properties: []NoteAttribute{
NoteAttribute{
{
Name: "note 1",
Value: "one",
},
NoteAttribute{
{
Name: "note 2",
Value: float64(2),
},
Expand All @@ -1223,12 +1223,12 @@ func validLineItem() LineItem {
Grams: 100,
FulfillmentStatus: OrderFulfillmentStatusPartial,
TaxLines: []TaxLine{
TaxLine{
{
Title: "State tax",
Price: &tl1Price,
Rate: &tl1Rate,
},
TaxLine{
{
Title: "Federal tax",
Price: &tl2Price,
Rate: &tl2Rate,
Expand Down
1 change: 0 additions & 1 deletion product_listing.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
)

const productListingBasePath = "product_listings"
const productsListingResourceName = "product_listings"

// ProductListingService is an interface for interfacing with the product listing endpoints
// of the Shopify API.
Expand Down

0 comments on commit d5d643a

Please sign in to comment.