diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6789f8d..8fa11f64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,8 +10,7 @@ jobs: shell: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Run sh-checker uses: luizm/action-sh-checker@master env: @@ -20,8 +19,7 @@ jobs: csharp: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Install C# dependencies run: make install-csharp - name: Lint project @@ -29,20 +27,17 @@ jobs: go: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.22 + go-version: 1.23 # install must occur in the same step as the linter to run properly on CI - name: Lint project - run: | - make install-go lint-go + run: make install-go lint-go java: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Install Java dependencies run: make install-java - name: Lint project @@ -50,8 +45,7 @@ jobs: node: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Install dependencies run: make install-node - name: Lint project @@ -61,8 +55,7 @@ jobs: php: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Install dependencies run: make install-php - name: Lint project @@ -70,8 +63,7 @@ jobs: python: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Install Python dependencies run: make install-python - name: Lint project @@ -81,10 +73,8 @@ jobs: ruby: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 with: ruby-version: '3.2' rubygems: '3.0.0' @@ -96,7 +86,6 @@ jobs: test: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Check for current dirs in docs run: ./test/ensure-current-dirs-exist.sh diff --git a/Makefile b/Makefile index 8eadcb0a..884bafc7 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ install-csharp: ## install-go - Install and vendor Go dependencies install-go: sh ./symlink_directory_files.sh style_guides/golang . - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_BIN) v1.59.1 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_BIN) v1.60.3 go mod vendor ## install-java - installs Java dependencies @@ -83,7 +83,7 @@ lint-csharp: ## lint-go - Lint Go files lint-go: - $(GO_BIN)/golangci-lint run + $(GO_BIN)/golangci-lint run official/docs/golang/current/... community/... official/guides/... ## lint-java - lints Java files lint-java: diff --git a/community/golang/concurrent_label_buy.go b/community/golang/concurrent_label_buy/concurrent_label_buy.go similarity index 100% rename from community/golang/concurrent_label_buy.go rename to community/golang/concurrent_label_buy/concurrent_label_buy.go diff --git a/community/golang/concurrent_refund.go b/community/golang/concurrent_refund/concurrent_refund.go similarity index 100% rename from community/golang/concurrent_refund.go rename to community/golang/concurrent_refund/concurrent_refund.go diff --git a/community/golang/concurrent_shipment_scanform.go b/community/golang/concurrent_shipment_scanform/concurrent_shipment_scanform.go similarity index 100% rename from community/golang/concurrent_shipment_scanform.go rename to community/golang/concurrent_shipment_scanform/concurrent_shipment_scanform.go diff --git a/community/golang/webhook_handler.go b/community/golang/webhook_handler/webhook_handler.go similarity index 98% rename from community/golang/webhook_handler.go rename to community/golang/webhook_handler/webhook_handler.go index a59ebb35..19f15027 100644 --- a/community/golang/webhook_handler.go +++ b/community/golang/webhook_handler/webhook_handler.go @@ -97,7 +97,7 @@ func (h *Handler) HandlePaymentEvent(event *easypost.Event) { } verb := strings.TrimPrefix(event.Description, "payment.") log.Printf( - "payment %s %s with amount %s and status %d\n", + "payment %s %s with amount %s and status %v\n", payment.ID, verb, payment.Amount, payment.Status, ) } diff --git a/go.mod b/go.mod index 27d1b2e4..cce1b425 100644 --- a/go.mod +++ b/go.mod @@ -5,5 +5,5 @@ go 1.15 require ( github.com/EasyPost/easypost-go/v2 v2.20.0 github.com/EasyPost/easypost-go/v3 v3.2.0 - github.com/EasyPost/easypost-go/v4 v4.3.0 + github.com/EasyPost/easypost-go/v4 v4.6.0 ) diff --git a/go.sum b/go.sum index cc394326..355eff5f 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/EasyPost/easypost-go/v2 v2.20.0 h1:DSqpwwTq2XDLg3Nlfk9KSoMHNEyZsqJSyM github.com/EasyPost/easypost-go/v2 v2.20.0/go.mod h1:+C9K2M4jvFSvN06xYXM2qom4zxmxPDTObQHu++C3hCs= github.com/EasyPost/easypost-go/v3 v3.2.0 h1:dNWmPG1AkpgYFJxhw/zGzCz1JOVXPpNIi8+JND4UHzk= github.com/EasyPost/easypost-go/v3 v3.2.0/go.mod h1:WDD0qkjwxedVKFXCcdJBz22rtRHpuxjGazgSVcTfdIw= -github.com/EasyPost/easypost-go/v4 v4.3.0 h1:UgYZOJuMK2mbXBHSrWlazGzYyYys14QstSFeFDQ98aM= -github.com/EasyPost/easypost-go/v4 v4.3.0/go.mod h1:WGoS4tmjHquhooMNmY6RirP+KWeYV/akcf/Jg9Q6fsk= +github.com/EasyPost/easypost-go/v4 v4.6.0 h1:wxMK4wkGEG5vW/4Vdy3rwE9iqww1eQ1xS6oYWUZbhrc= +github.com/EasyPost/easypost-go/v4 v4.6.0/go.mod h1:WGoS4tmjHquhooMNmY6RirP+KWeYV/akcf/Jg9Q6fsk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= diff --git a/official/docs/golang/current/addresses/create-and-verify.go b/official/docs/golang/current/addresses/create-and-verify.go index 6de26c5e..16d81885 100644 --- a/official/docs/golang/current/addresses/create-and-verify.go +++ b/official/docs/golang/current/addresses/create-and-verify.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func createAndVerify() { client := easypost.New("EASYPOST_API_KEY") address, _ := client.CreateAndVerifyAddress( diff --git a/official/docs/golang/current/addresses/create.go b/official/docs/golang/current/addresses/create.go index b658be01..64f50cf1 100644 --- a/official/docs/golang/current/addresses/create.go +++ b/official/docs/golang/current/addresses/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") address, _ := client.CreateAddress( diff --git a/official/docs/golang/current/addresses/list.go b/official/docs/golang/current/addresses/list.go index 4334f19e..014f28ec 100644 --- a/official/docs/golang/current/addresses/list.go +++ b/official/docs/golang/current/addresses/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") addresses, _ := client.ListAddresses( diff --git a/official/docs/golang/current/addresses/retrieve.go b/official/docs/golang/current/addresses/retrieve.go index a64a9e94..2719fbad 100644 --- a/official/docs/golang/current/addresses/retrieve.go +++ b/official/docs/golang/current/addresses/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") address, _ := client.GetAddress("adr_...") diff --git a/official/docs/golang/current/addresses/verify-failure.go b/official/docs/golang/current/addresses/verify-failure.go index ef4b059a..2b296b38 100644 --- a/official/docs/golang/current/addresses/verify-failure.go +++ b/official/docs/golang/current/addresses/verify-failure.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func verifyFailure() { client := easypost.New("EASYPOST_API_KEY") address, _ := client.CreateAddress( diff --git a/official/docs/golang/current/addresses/verify-param.go b/official/docs/golang/current/addresses/verify-param.go index 7f4d4263..7c66f54d 100644 --- a/official/docs/golang/current/addresses/verify-param.go +++ b/official/docs/golang/current/addresses/verify-param.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func verifyParam() { client := easypost.New("EASYPOST_API_KEY") address, _ := client.CreateAddress( diff --git a/official/docs/golang/current/addresses/verify-strict-param.go b/official/docs/golang/current/addresses/verify-strict-param.go index d42bd310..9f56655c 100644 --- a/official/docs/golang/current/addresses/verify-strict-param.go +++ b/official/docs/golang/current/addresses/verify-strict-param.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func verifyStrictParam() { client := easypost.New("EASYPOST_API_KEY") address, _ := client.CreateAddress( diff --git a/official/docs/golang/current/addresses/verify.go b/official/docs/golang/current/addresses/verify.go index 1e6cd491..dc580a41 100644 --- a/official/docs/golang/current/addresses/verify.go +++ b/official/docs/golang/current/addresses/verify.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func verify() { client := easypost.New("EASYPOST_API_KEY") address, _ := client.VerifyAddress("adr_...") diff --git a/official/docs/golang/current/api-keys/retrieve.go b/official/docs/golang/current/api-keys/retrieve.go index 1afe6da6..9ce4eb99 100644 --- a/official/docs/golang/current/api-keys/retrieve.go +++ b/official/docs/golang/current/api-keys/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") // Retrieve all API keys including children diff --git a/official/docs/golang/current/batches/add-shipments.go b/official/docs/golang/current/batches/add-shipments.go index 0bdd5860..90bbd129 100644 --- a/official/docs/golang/current/batches/add-shipments.go +++ b/official/docs/golang/current/batches/add-shipments.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func addShipments() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.GetShipment("shp_...") diff --git a/official/docs/golang/current/batches/buy.go b/official/docs/golang/current/batches/buy.go index e861d95a..d0e9599e 100644 --- a/official/docs/golang/current/batches/buy.go +++ b/official/docs/golang/current/batches/buy.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func buy() { client := easypost.New("EASYPOST_API_KEY") createdBatch, _ := client.CreateBatch( diff --git a/official/docs/golang/current/batches/create.go b/official/docs/golang/current/batches/create.go index a923e81e..fd87ac28 100644 --- a/official/docs/golang/current/batches/create.go +++ b/official/docs/golang/current/batches/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.GetShipment("shp_...") diff --git a/official/docs/golang/current/batches/label.go b/official/docs/golang/current/batches/label.go index 7c7840d6..f08a4f9f 100644 --- a/official/docs/golang/current/batches/label.go +++ b/official/docs/golang/current/batches/label.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func label() { client := easypost.New("EASYPOST_API_KEY") batch, _ := client.GetBatchLabels("batch_...", "PDF") diff --git a/official/docs/golang/current/batches/list.go b/official/docs/golang/current/batches/list.go index 4f0a596e..59f3dfa2 100644 --- a/official/docs/golang/current/batches/list.go +++ b/official/docs/golang/current/batches/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") batches, _ := client.ListBatches( diff --git a/official/docs/golang/current/batches/remove-shipments.go b/official/docs/golang/current/batches/remove-shipments.go index 57446c24..952f50c3 100644 --- a/official/docs/golang/current/batches/remove-shipments.go +++ b/official/docs/golang/current/batches/remove-shipments.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func removeShipments() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.GetShipment("shp_...") diff --git a/official/docs/golang/current/batches/retrieve.go b/official/docs/golang/current/batches/retrieve.go index 78d716d6..6c36de19 100644 --- a/official/docs/golang/current/batches/retrieve.go +++ b/official/docs/golang/current/batches/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") batch, _ := client.GetBatch("batch_...") diff --git a/official/docs/golang/current/batches/scan-forms.go b/official/docs/golang/current/batches/scan-forms.go index bf7c1ec4..eb41a9d6 100644 --- a/official/docs/golang/current/batches/scan-forms.go +++ b/official/docs/golang/current/batches/scan-forms.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func scanForms() { client := easypost.New("EASYPOST_API_KEY") batch, _ := client.CreateBatchScanForms("batch_...", "pdf") diff --git a/official/docs/golang/current/billing/create-ep-credit-card.go b/official/docs/golang/current/billing/create-ep-credit-card.go index ad390327..1cd27787 100644 --- a/official/docs/golang/current/billing/create-ep-credit-card.go +++ b/official/docs/golang/current/billing/create-ep-credit-card.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func createEpCreditCard() { client := easypost.New("EASYPOST_API_KEY") creditCard, _ := client.AddReferralCustomerCreditCard("REFERRAL_USER_API_KEY", &easypost.CreditCardOptions{ diff --git a/official/docs/golang/current/billing/delete.go b/official/docs/golang/current/billing/delete.go index 4f584c50..57d9bec0 100644 --- a/official/docs/golang/current/billing/delete.go +++ b/official/docs/golang/current/billing/delete.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func delete() { client := easypost.New("EASYPOST_API_KEY") err := client.DeletePaymentMethod(easypost.PrimaryPaymentMethodPriority) diff --git a/official/docs/golang/current/billing/fund.go b/official/docs/golang/current/billing/fund.go index 0718fb22..2434fe1f 100644 --- a/official/docs/golang/current/billing/fund.go +++ b/official/docs/golang/current/billing/fund.go @@ -4,8 +4,8 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func fund() { client := easypost.New("EASYPOST_API_KEY") - client.FundWallet("2000", easypost.PrimaryPaymentMethodPriority) + _ = client.FundWallet("2000", easypost.PrimaryPaymentMethodPriority) } diff --git a/official/docs/golang/current/billing/list.go b/official/docs/golang/current/billing/list.go index f791896a..b363f016 100644 --- a/official/docs/golang/current/billing/list.go +++ b/official/docs/golang/current/billing/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") paymentMethods, _ := client.RetrievePaymentMethods() diff --git a/official/docs/golang/current/brand/update.go b/official/docs/golang/current/brand/update.go index a3a79107..352ebabe 100644 --- a/official/docs/golang/current/brand/update.go +++ b/official/docs/golang/current/brand/update.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func brand() { client := easypost.New("EASYPOST_API_KEY") brand, _ := client.UpdateBrand( diff --git a/official/docs/golang/current/carrier-accounts/create.go b/official/docs/golang/current/carrier-accounts/create.go index 84bc0e77..e93ac5c9 100644 --- a/official/docs/golang/current/carrier-accounts/create.go +++ b/official/docs/golang/current/carrier-accounts/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") carrierAccount, _ := client.CreateCarrierAccount( @@ -28,6 +28,8 @@ func main() { }, ) + fmt.Println(carrierAccount) + // For UPS account creation, please use below method instead createUpsParameters := &easypost.UpsCarrierAccountCreationParameters{ @@ -35,7 +37,7 @@ func main() { Type: "UpsAccount", } - carrierAccount, err := client.CreateUpsCarrierAccount(createUpsParameters) + carrierAccount, _ = client.CreateUpsCarrierAccount(createUpsParameters) fmt.Println(carrierAccount) } diff --git a/official/docs/golang/current/carrier-accounts/delete.go b/official/docs/golang/current/carrier-accounts/delete.go index 2fa50a8c..4e375cd9 100644 --- a/official/docs/golang/current/carrier-accounts/delete.go +++ b/official/docs/golang/current/carrier-accounts/delete.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func delete() { client := easypost.New("EASYPOST_API_KEY") err := client.DeleteCarrierAccount("ca_...") diff --git a/official/docs/golang/current/carrier-accounts/list.go b/official/docs/golang/current/carrier-accounts/list.go index 4669dbe2..bb9ca894 100644 --- a/official/docs/golang/current/carrier-accounts/list.go +++ b/official/docs/golang/current/carrier-accounts/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") carrierAccounts, _ := client.ListCarrierAccounts() diff --git a/official/docs/golang/current/carrier-accounts/retrieve.go b/official/docs/golang/current/carrier-accounts/retrieve.go index 8d599eff..bafc15a4 100644 --- a/official/docs/golang/current/carrier-accounts/retrieve.go +++ b/official/docs/golang/current/carrier-accounts/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") carrierAccount, _ := client.GetCarrierAccount("ca_...") diff --git a/official/docs/golang/current/carrier-accounts/update.go b/official/docs/golang/current/carrier-accounts/update.go index dc699a03..60e82c1e 100644 --- a/official/docs/golang/current/carrier-accounts/update.go +++ b/official/docs/golang/current/carrier-accounts/update.go @@ -6,10 +6,10 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func update() { client := easypost.New("EASYPOST_API_KEY") - carrierAccount, _ = client.UpdateCarrierAccount( + carrierAccount, _ := client.UpdateCarrierAccount( &easypost.CarrierAccount{ ID: "ca_...", Description: "FL Location DHL eCommerce Solutions Account", @@ -25,7 +25,7 @@ func main() { AccountNumber: "987654321", } - carrierAccount, err := client.UpdateUpsCarrierAccount(carrierAccount.ID, updateParameters) + carrierAccount, _ = client.UpdateUpsCarrierAccount(carrierAccount.ID, updateParameters) fmt.Println(carrierAccount) } diff --git a/official/docs/golang/current/carrier-metadata/retrieve.go b/official/docs/golang/current/carrier-metadata/retrieve.go index c654bdb0..680ed3c7 100644 --- a/official/docs/golang/current/carrier-metadata/retrieve.go +++ b/official/docs/golang/current/carrier-metadata/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") // Request all metadata for all carriers diff --git a/official/docs/golang/current/carrier-types/list.go b/official/docs/golang/current/carrier-types/list.go index 060a5bdc..3c8d3502 100644 --- a/official/docs/golang/current/carrier-types/list.go +++ b/official/docs/golang/current/carrier-types/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") carrierTypes, _ := client.GetCarrierTypes() diff --git a/official/docs/golang/current/child-users/create.go b/official/docs/golang/current/child-users/create.go index 580a61b3..1b89c128 100644 --- a/official/docs/golang/current/child-users/create.go +++ b/official/docs/golang/current/child-users/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") userName := "Child Account Name" diff --git a/official/docs/golang/current/child-users/delete.go b/official/docs/golang/current/child-users/delete.go index ffeb423f..097b2693 100644 --- a/official/docs/golang/current/child-users/delete.go +++ b/official/docs/golang/current/child-users/delete.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func delete() { client := easypost.New("EASYPOST_API_KEY") err := client.DeleteUser("user_...") diff --git a/official/docs/golang/current/child-users/list.go b/official/docs/golang/current/child-users/list.go index 0eabadb0..4c2cc165 100644 --- a/official/docs/golang/current/child-users/list.go +++ b/official/docs/golang/current/child-users/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") childUsers, _ := client.ListChildUsers( diff --git a/official/docs/golang/current/claims/cancel.go b/official/docs/golang/current/claims/cancel.go index b80ea1c0..2533f16a 100644 --- a/official/docs/golang/current/claims/cancel.go +++ b/official/docs/golang/current/claims/cancel.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func cancel() { client := easypost.New("EASYPOST_API_KEY") claim, _ := client.CancelClaim("clm_...") diff --git a/official/docs/golang/current/claims/create.go b/official/docs/golang/current/claims/create.go index 56f808b1..17419ce7 100644 --- a/official/docs/golang/current/claims/create.go +++ b/official/docs/golang/current/claims/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") claim, _ := client.CreateClaim( diff --git a/official/docs/golang/current/claims/list.go b/official/docs/golang/current/claims/list.go index b3dbe9e9..794da003 100644 --- a/official/docs/golang/current/claims/list.go +++ b/official/docs/golang/current/claims/list.go @@ -6,11 +6,11 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") claims, _ := client.ListClaims( - &easypost.ListOptions{ + &easypost.ListClaimsParameters{ PageSize: 5, }, ) diff --git a/official/docs/golang/current/claims/retrieve.go b/official/docs/golang/current/claims/retrieve.go index b97a1403..2e21dbdd 100644 --- a/official/docs/golang/current/claims/retrieve.go +++ b/official/docs/golang/current/claims/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") claim, _ := client.GetClaim("clm_...") diff --git a/official/docs/golang/current/customs-infos/create.go b/official/docs/golang/current/customs-infos/create.go index 35712725..d3b7218d 100644 --- a/official/docs/golang/current/customs-infos/create.go +++ b/official/docs/golang/current/customs-infos/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") customsInfo, _ := client.CreateCustomsInfo( diff --git a/official/docs/golang/current/customs-infos/retrieve.go b/official/docs/golang/current/customs-infos/retrieve.go index 12a9f87c..36375fa6 100644 --- a/official/docs/golang/current/customs-infos/retrieve.go +++ b/official/docs/golang/current/customs-infos/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") customsInfo, _ := client.GetCustomsInfo("cstinfo_...") diff --git a/official/docs/golang/current/customs-items/create.go b/official/docs/golang/current/customs-items/create.go index b6d1a9d1..fed3b8a7 100644 --- a/official/docs/golang/current/customs-items/create.go +++ b/official/docs/golang/current/customs-items/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") customsItem, _ := client.CreateCustomsItem( diff --git a/official/docs/golang/current/customs-items/retrieve.go b/official/docs/golang/current/customs-items/retrieve.go index 4ff2eb20..b26b56ac 100644 --- a/official/docs/golang/current/customs-items/retrieve.go +++ b/official/docs/golang/current/customs-items/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") customsItem, _ := client.GetCustomsItem("cstitem_...") diff --git a/official/docs/golang/current/endshipper/buy.go b/official/docs/golang/current/endshipper/buy.go index f193bef5..f9ac6ff2 100644 --- a/official/docs/golang/current/endshipper/buy.go +++ b/official/docs/golang/current/endshipper/buy.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func buy() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.GetShipment("shp_...") diff --git a/official/docs/golang/current/endshipper/create.go b/official/docs/golang/current/endshipper/create.go index 4f952b01..b44e47fa 100644 --- a/official/docs/golang/current/endshipper/create.go +++ b/official/docs/golang/current/endshipper/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") endshipper, _ := client.CreateEndShipper( diff --git a/official/docs/golang/current/endshipper/list.go b/official/docs/golang/current/endshipper/list.go index b8b011cc..6f3ca78a 100644 --- a/official/docs/golang/current/endshipper/list.go +++ b/official/docs/golang/current/endshipper/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") endshippers, _ := client.ListEndShippers( diff --git a/official/docs/golang/current/endshipper/retrieve.go b/official/docs/golang/current/endshipper/retrieve.go index 1ea31956..c3b1c57a 100644 --- a/official/docs/golang/current/endshipper/retrieve.go +++ b/official/docs/golang/current/endshipper/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") retrievedEndShipper, _ := client.GetEndShipper("es_...") diff --git a/official/docs/golang/current/endshipper/update.go b/official/docs/golang/current/endshipper/update.go index 660d930b..b28a6d29 100644 --- a/official/docs/golang/current/endshipper/update.go +++ b/official/docs/golang/current/endshipper/update.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func update() { client := easypost.New("EASYPOST_API_KEY") endShipper, _ := client.GetEndShipper("es_...") diff --git a/official/docs/golang/current/events/list.go b/official/docs/golang/current/events/list.go index 8fafcfa8..13ff840f 100644 --- a/official/docs/golang/current/events/list.go +++ b/official/docs/golang/current/events/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") events, _ := client.ListEvents( diff --git a/official/docs/golang/current/events/retrieve.go b/official/docs/golang/current/events/retrieve.go index 992826bc..4e39fc91 100644 --- a/official/docs/golang/current/events/retrieve.go +++ b/official/docs/golang/current/events/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") event, _ := client.GetEvent("evt_...") diff --git a/official/docs/golang/current/forms/create.go b/official/docs/golang/current/forms/create.go index b90ae7cd..10a29032 100644 --- a/official/docs/golang/current/forms/create.go +++ b/official/docs/golang/current/forms/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") shipmentWithForm, _ := client.GenerateShipmentForm("shp_...", "return_packing_slip") diff --git a/official/docs/golang/current/insurance/create.go b/official/docs/golang/current/insurance/create.go index f316b8ec..54dec3e6 100644 --- a/official/docs/golang/current/insurance/create.go +++ b/official/docs/golang/current/insurance/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") toAddress, _ := client.GetAddress("adr_...") diff --git a/official/docs/golang/current/insurance/list.go b/official/docs/golang/current/insurance/list.go index 847500d9..f89668d5 100644 --- a/official/docs/golang/current/insurance/list.go +++ b/official/docs/golang/current/insurance/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") insurances, _ := client.ListInsurances( diff --git a/official/docs/golang/current/insurance/refund.go b/official/docs/golang/current/insurance/refund.go index 65cf834b..0dd9ab02 100644 --- a/official/docs/golang/current/insurance/refund.go +++ b/official/docs/golang/current/insurance/refund.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func refund() { client := easypost.New("EASYPOST_API_KEY") insurance, _ := client.RefundInsurance("ins_...") diff --git a/official/docs/golang/current/insurance/retrieve.go b/official/docs/golang/current/insurance/retrieve.go index 6678fec1..4c94509d 100644 --- a/official/docs/golang/current/insurance/retrieve.go +++ b/official/docs/golang/current/insurance/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") insurance, _ := client.GetInsurance("ins_...") diff --git a/official/docs/golang/current/options/create-with-options.go b/official/docs/golang/current/options/create-with-options.go index 5fbaec11..4e465249 100644 --- a/official/docs/golang/current/options/create-with-options.go +++ b/official/docs/golang/current/options/create-with-options.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func createWithOptions() { client := easypost.New("EASYPOST_API_KEY") toAddress, _ := client.GetAddress("shp_...") diff --git a/official/docs/golang/current/orders/buy.go b/official/docs/golang/current/orders/buy.go index 1ecf9057..f2ccc724 100644 --- a/official/docs/golang/current/orders/buy.go +++ b/official/docs/golang/current/orders/buy.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func buy() { client := easypost.New("EASYPOST_API_KEY") order, _ := client.BuyOrder("order_...", "FedEx", "FEDEX_GROUND") diff --git a/official/docs/golang/current/orders/create.go b/official/docs/golang/current/orders/create.go index 65cca485..4309ec7b 100644 --- a/official/docs/golang/current/orders/create.go +++ b/official/docs/golang/current/orders/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") toAddress, _ := client.GetAddress("adr_...") diff --git a/official/docs/golang/current/orders/one-call-buy.go b/official/docs/golang/current/orders/one-call-buy.go index b6d998b2..b4f2ac60 100644 --- a/official/docs/golang/current/orders/one-call-buy.go +++ b/official/docs/golang/current/orders/one-call-buy.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func oneCallBuy() { client := easypost.New("EASYPOST_API_KEY") toAddress, _ := client.GetAddress("adr_...") diff --git a/official/docs/golang/current/orders/retrieve.go b/official/docs/golang/current/orders/retrieve.go index e79620b7..8a3ee172 100644 --- a/official/docs/golang/current/orders/retrieve.go +++ b/official/docs/golang/current/orders/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") order, _ := client.GetOrder("order_...") diff --git a/official/docs/golang/current/pagination/get-next-page.go b/official/docs/golang/current/pagination/get-next-page.go index 63ab607d..08171bce 100644 --- a/official/docs/golang/current/pagination/get-next-page.go +++ b/official/docs/golang/current/pagination/get-next-page.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func getNextPage() { client := easypost.New("EASYPOST_API_KEY") // Get first page of results diff --git a/official/docs/golang/current/parcels/create.go b/official/docs/golang/current/parcels/create.go index a655d50d..3b8a79b1 100644 --- a/official/docs/golang/current/parcels/create.go +++ b/official/docs/golang/current/parcels/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") parcel, _ := client.CreateParcel( diff --git a/official/docs/golang/current/parcels/retrieve.go b/official/docs/golang/current/parcels/retrieve.go index 4c538ff2..142f7596 100644 --- a/official/docs/golang/current/parcels/retrieve.go +++ b/official/docs/golang/current/parcels/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") parcel, _ := client.GetParcel("prcl_...") diff --git a/official/docs/golang/current/payloads/list.go b/official/docs/golang/current/payloads/list.go index 9625fef1..0ff1ad4c 100644 --- a/official/docs/golang/current/payloads/list.go +++ b/official/docs/golang/current/payloads/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") payloads, _ := client.ListEventPayloads("evt_...") diff --git a/official/docs/golang/current/payloads/retrieve.go b/official/docs/golang/current/payloads/retrieve.go index 71bd1e8d..6511c26d 100644 --- a/official/docs/golang/current/payloads/retrieve.go +++ b/official/docs/golang/current/payloads/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") payload, _ := client.GetEventPayload("evt_...", "payload_...") diff --git a/official/docs/golang/current/pickups/buy.go b/official/docs/golang/current/pickups/buy.go index e6baa21b..8b34873e 100644 --- a/official/docs/golang/current/pickups/buy.go +++ b/official/docs/golang/current/pickups/buy.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func buy() { client := easypost.New("EASYPOST_API_KEY") rate := &easypost.PickupRate{Carrier: "UPS", Service: "Same-day Pickup"} diff --git a/official/docs/golang/current/pickups/cancel.go b/official/docs/golang/current/pickups/cancel.go index a6c19efb..b1b18b04 100644 --- a/official/docs/golang/current/pickups/cancel.go +++ b/official/docs/golang/current/pickups/cancel.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func cancel() { client := easypost.New("EASYPOST_API_KEY") pickup, _ := client.CancelPickup("pickup_...") diff --git a/official/docs/golang/current/pickups/create.go b/official/docs/golang/current/pickups/create.go index 056ee3f4..6d68630a 100644 --- a/official/docs/golang/current/pickups/create.go +++ b/official/docs/golang/current/pickups/create.go @@ -7,22 +7,24 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") - address, _ := client.GetAddress("adr_...") - shipment, _ := client.GetShipment("shp_...") - minPickupTime := time.Now() // now - maxPickupTime := time.Now().Add(time.Hour * 24 * 7) // 7 days from now + var minDatetime easypost.DateTime = easypost.DateTime(time.Now()) + var maxDatetime easypost.DateTime = easypost.DateTime(time.Now().Add(time.Hour * 24 * 7)) pickup, _ := client.CreatePickup( &easypost.Pickup{ IsAccountAddress: false, - Address: address, - Shipment: shipment, - MinDatetime: &minPickupTime, - MaxDatetime: &maxPickupTime, - Instructions: "Special pickup instructions", + Address: &easypost.Address{ + ID: "adr_...", + }, + Shipment: &easypost.Shipment{ + ID: "shp_...", + }, + MinDatetime: &minDatetime, + MaxDatetime: &maxDatetime, + Instructions: "Special pickup instructions", }, ) diff --git a/official/docs/golang/current/pickups/list.go b/official/docs/golang/current/pickups/list.go index b99b08aa..fe10aae3 100644 --- a/official/docs/golang/current/pickups/list.go +++ b/official/docs/golang/current/pickups/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") pickups, _ := client.ListPickups( diff --git a/official/docs/golang/current/pickups/retrieve.go b/official/docs/golang/current/pickups/retrieve.go index 751796eb..a00426f7 100644 --- a/official/docs/golang/current/pickups/retrieve.go +++ b/official/docs/golang/current/pickups/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") pickup, _ := client.GetPickup("pickup_...") diff --git a/official/docs/golang/current/rates/regenerate.go b/official/docs/golang/current/rates/regenerate.go index db8d8835..7810d1b0 100644 --- a/official/docs/golang/current/rates/regenerate.go +++ b/official/docs/golang/current/rates/regenerate.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func regenerate() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.RerateShipment("shp_...") diff --git a/official/docs/golang/current/rates/retrieve-stateless.go b/official/docs/golang/current/rates/retrieve-stateless.go index 1658cbd6..a25ff541 100644 --- a/official/docs/golang/current/rates/retrieve-stateless.go +++ b/official/docs/golang/current/rates/retrieve-stateless.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieveStateless() { client := easypost.New("EASYPOST_API_KEY") shipmentDetails := &easypost.Shipment{ diff --git a/official/docs/golang/current/rates/retrieve.go b/official/docs/golang/current/rates/retrieve.go index 3733b3cc..e5a0aec3 100644 --- a/official/docs/golang/current/rates/retrieve.go +++ b/official/docs/golang/current/rates/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") rate, _ := client.GetRate("rate...") diff --git a/official/docs/golang/current/referral-customers/add-payment-method-with-bank-account.go b/official/docs/golang/current/referral-customers/add-payment-method-with-bank-account.go index aa987d6b..0ec1520a 100644 --- a/official/docs/golang/current/referral-customers/add-payment-method-with-bank-account.go +++ b/official/docs/golang/current/referral-customers/add-payment-method-with-bank-account.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func addPaymentMethodWithBankAccount() { client := easypost.New("EASYPOST_API_KEY") paymentMethod, _ := client.BetaAddPaymentMethod("cus_...", "ba_...", easypost.PrimaryPaymentMethodPriority) diff --git a/official/docs/golang/current/referral-customers/add-payment-method-with-credit-card.go b/official/docs/golang/current/referral-customers/add-payment-method-with-credit-card.go index 195acc8a..26417bf7 100644 --- a/official/docs/golang/current/referral-customers/add-payment-method-with-credit-card.go +++ b/official/docs/golang/current/referral-customers/add-payment-method-with-credit-card.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func addPaymentMethodWithCreditCard() { client := easypost.New("EASYPOST_API_KEY") paymentMethod, _ := client.BetaAddPaymentMethod("cus_...", "card_...", easypost.PrimaryPaymentMethodPriority) diff --git a/official/docs/golang/current/referral-customers/create.go b/official/docs/golang/current/referral-customers/create.go index 7411eef4..bd11fb2d 100644 --- a/official/docs/golang/current/referral-customers/create.go +++ b/official/docs/golang/current/referral-customers/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") name := "Test Referral" diff --git a/official/docs/golang/current/referral-customers/list.go b/official/docs/golang/current/referral-customers/list.go index 702960bc..e8a68979 100644 --- a/official/docs/golang/current/referral-customers/list.go +++ b/official/docs/golang/current/referral-customers/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") referralCustomerCollection, _ := client.ListReferralCustomers( diff --git a/official/docs/golang/current/referral-customers/refund-by-amount.go b/official/docs/golang/current/referral-customers/refund-by-amount.go index 251aaa29..1067c01b 100644 --- a/official/docs/golang/current/referral-customers/refund-by-amount.go +++ b/official/docs/golang/current/referral-customers/refund-by-amount.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func refundByAmount() { client := easypost.New("EASYPOST_API_KEY") refund, _ := client.BetaRefundByAmount(2000) diff --git a/official/docs/golang/current/referral-customers/refund-by-payment-log.go b/official/docs/golang/current/referral-customers/refund-by-payment-log.go index ddfa6dd8..ef20fd40 100644 --- a/official/docs/golang/current/referral-customers/refund-by-payment-log.go +++ b/official/docs/golang/current/referral-customers/refund-by-payment-log.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func refundByPaymentLog() { client := easypost.New("EASYPOST_API_KEY") refund, _ := client.BetaRefundByPaymentLog("paylog_...") diff --git a/official/docs/golang/current/referral-customers/update.go b/official/docs/golang/current/referral-customers/update.go index d6821b3b..1db80c5e 100644 --- a/official/docs/golang/current/referral-customers/update.go +++ b/official/docs/golang/current/referral-customers/update.go @@ -4,7 +4,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func update() { client := easypost.New("EASYPOST_API_KEY") _, _ = client.UpdateReferralCustomerEmail("user_...", "new_email@example.com") diff --git a/official/docs/golang/current/refunds/create.go b/official/docs/golang/current/refunds/create.go index 0845d3d1..abc14209 100644 --- a/official/docs/golang/current/refunds/create.go +++ b/official/docs/golang/current/refunds/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") refunds, _ := client.CreateRefund( diff --git a/official/docs/golang/current/refunds/list.go b/official/docs/golang/current/refunds/list.go index 57b160a7..955a32be 100644 --- a/official/docs/golang/current/refunds/list.go +++ b/official/docs/golang/current/refunds/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") refunds, _ := client.ListRefunds( diff --git a/official/docs/golang/current/refunds/retrieve.go b/official/docs/golang/current/refunds/retrieve.go index 7b18916e..4791e397 100644 --- a/official/docs/golang/current/refunds/retrieve.go +++ b/official/docs/golang/current/refunds/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") refund, _ := client.GetRefund("shp_...") diff --git a/official/docs/golang/current/reports/create.go b/official/docs/golang/current/reports/create.go index 237ad9d7..17560199 100644 --- a/official/docs/golang/current/reports/create.go +++ b/official/docs/golang/current/reports/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") reportOptions := &easypost.Report{ diff --git a/official/docs/golang/current/reports/list.go b/official/docs/golang/current/reports/list.go index 8d17c9ae..771d3e6b 100644 --- a/official/docs/golang/current/reports/list.go +++ b/official/docs/golang/current/reports/list.go @@ -6,16 +6,14 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") - reportOptions := &easypost.ListReportsOptions{ - PageSize: 5, - } - reports, _ := client.ListReports( "payment_log", - reportOptions, + &easypost.ListOptions{ + PageSize: 5, + }, ) fmt.Println(reports) diff --git a/official/docs/golang/current/reports/retrieve.go b/official/docs/golang/current/reports/retrieve.go index 9c95145f..a4bc568b 100644 --- a/official/docs/golang/current/reports/retrieve.go +++ b/official/docs/golang/current/reports/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") report, _ := client.GetReport("", "") diff --git a/official/docs/golang/current/returns/create.go b/official/docs/golang/current/returns/create.go index 57c73256..1d2f2b56 100644 --- a/official/docs/golang/current/returns/create.go +++ b/official/docs/golang/current/returns/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") toAddress, _ := client.GetAddress("adr_...") diff --git a/official/docs/golang/current/scan-form/create.go b/official/docs/golang/current/scan-form/create.go index d8b03ac9..1c3b7420 100644 --- a/official/docs/golang/current/scan-form/create.go +++ b/official/docs/golang/current/scan-form/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") scanForm, _ := client.CreateScanForm("shp_...", "shp_...") diff --git a/official/docs/golang/current/scan-form/list.go b/official/docs/golang/current/scan-form/list.go index 73244fab..ca6cbda9 100644 --- a/official/docs/golang/current/scan-form/list.go +++ b/official/docs/golang/current/scan-form/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") scanForms, _ := client.ListScanForms( diff --git a/official/docs/golang/current/scan-form/retrieve.go b/official/docs/golang/current/scan-form/retrieve.go index 11b9fbb9..573881f4 100644 --- a/official/docs/golang/current/scan-form/retrieve.go +++ b/official/docs/golang/current/scan-form/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") scanForm, _ := client.GetScanForm("sf_...") diff --git a/official/docs/golang/current/shipments/buy.go b/official/docs/golang/current/shipments/buy.go index f826fce3..30502771 100644 --- a/official/docs/golang/current/shipments/buy.go +++ b/official/docs/golang/current/shipments/buy.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func buy() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.GetShipment("shp_...") diff --git a/official/docs/golang/current/shipments/create.go b/official/docs/golang/current/shipments/create.go index 667538c7..c7f90d40 100644 --- a/official/docs/golang/current/shipments/create.go +++ b/official/docs/golang/current/shipments/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.CreateShipment( diff --git a/official/docs/golang/current/shipments/label.go b/official/docs/golang/current/shipments/label.go index a73f7599..d7e7c423 100644 --- a/official/docs/golang/current/shipments/label.go +++ b/official/docs/golang/current/shipments/label.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func label() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.GetShipmentLabel("shp_...", "ZPL") diff --git a/official/docs/golang/current/shipments/list.go b/official/docs/golang/current/shipments/list.go index b44cd359..42b42be8 100644 --- a/official/docs/golang/current/shipments/list.go +++ b/official/docs/golang/current/shipments/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") shipments, _ := client.ListShipments( diff --git a/official/docs/golang/current/shipments/one-call-buy.go b/official/docs/golang/current/shipments/one-call-buy.go index 21546104..835fb10d 100644 --- a/official/docs/golang/current/shipments/one-call-buy.go +++ b/official/docs/golang/current/shipments/one-call-buy.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func oneCallBuy() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.CreateShipment( diff --git a/official/docs/golang/current/shipments/retrieve.go b/official/docs/golang/current/shipments/retrieve.go index 0fad4048..443c1186 100644 --- a/official/docs/golang/current/shipments/retrieve.go +++ b/official/docs/golang/current/shipments/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.GetShipment("shp_...") diff --git a/official/docs/golang/current/shipping-insurance/insure.go b/official/docs/golang/current/shipping-insurance/insure.go index 05646be9..23901090 100644 --- a/official/docs/golang/current/shipping-insurance/insure.go +++ b/official/docs/golang/current/shipping-insurance/insure.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func insure() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.InsureShipment("shp_...", "100.00") diff --git a/official/docs/golang/current/shipping-refund/refund.go b/official/docs/golang/current/shipping-refund/refund.go index a9d8ebc3..7a3f5024 100644 --- a/official/docs/golang/current/shipping-refund/refund.go +++ b/official/docs/golang/current/shipping-refund/refund.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func refund() { client := easypost.New("EASYPOST_API_KEY") shipment, _ := client.RefundShipment("shp_...") diff --git a/official/docs/golang/current/smartrate/retrieve-estimated-delivery-date.go b/official/docs/golang/current/smartrate/retrieve-estimated-delivery-date.go index 1cc5091d..2ab8a35a 100644 --- a/official/docs/golang/current/smartrate/retrieve-estimated-delivery-date.go +++ b/official/docs/golang/current/smartrate/retrieve-estimated-delivery-date.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieveEstimatedDeliveryDate() { client := easypost.New("EASYPOST_API_KEY") estimatedDeliveryDates, _ := client.GetShipmentEstimatedDeliveryDate("shp_...", "YYYY-MM-DD") diff --git a/official/docs/golang/current/smartrate/retrieve-recommend-ship-date.go b/official/docs/golang/current/smartrate/retrieve-recommend-ship-date.go index 15b033ca..600d0823 100644 --- a/official/docs/golang/current/smartrate/retrieve-recommend-ship-date.go +++ b/official/docs/golang/current/smartrate/retrieve-recommend-ship-date.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieveRecommendShipDate() { client := easypost.New("EASYPOST_API_KEY") rates, _ := client.RecommendShipDateForShipment("shp_...", "YYYY-MM-DD") diff --git a/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-by.go b/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-by.go index 792a99ad..2ebf5fc0 100644 --- a/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-by.go +++ b/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-by.go @@ -6,14 +6,14 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieveStandaloneSmartrateDeliverBy() { client := easypost.New("EASYPOST_API_KEY") params := &easypost.EstimateDeliveryDateForZipPairParams{ - OriginPostalCode: "10001", - DestinationPostalCode: "10002", - Carriers: []string{"UPS", "FedEx"}, - PlannedShipDate: "2024-07-18", + FromZip: "10001", + ToZip: "10002", + Carriers: []string{"UPS", "FedEx"}, + PlannedShipDate: "2024-07-18", } estimates, _ := client.EstimateDeliveryDateForZipPair(params) diff --git a/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-on.go b/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-on.go index 16200b7f..f457d2fd 100644 --- a/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-on.go +++ b/official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-on.go @@ -6,14 +6,14 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieveStandaloneSmartrateDeliverOn() { client := easypost.New("EASYPOST_API_KEY") params := &easypost.RecommendShipDateForZipPairParams{ - OriginPostalCode: "10001", - DestinationPostalCode: "10002", - Carriers: []string{"UPS", "FedEx"}, - DesiredDeliveryDate: "2024-07-18", + FromZip: "10001", + ToZip: "10002", + Carriers: []string{"UPS", "FedEx"}, + DesiredDeliveryDate: "2024-07-18", } recommendations, _ := client.RecommendShipDateForZipPair(params) diff --git a/official/docs/golang/current/smartrate/retrieve-time-in-transit-statistics.go b/official/docs/golang/current/smartrate/retrieve-time-in-transit-statistics.go index 6ed510aa..fc2ec4d4 100644 --- a/official/docs/golang/current/smartrate/retrieve-time-in-transit-statistics.go +++ b/official/docs/golang/current/smartrate/retrieve-time-in-transit-statistics.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieveTimeInTransitStatistics() { client := easypost.New("EASYPOST_API_KEY") smartRates, _ := client.GetShipmentSmartrates("shp_...") diff --git a/official/docs/golang/current/tax-identifiers/create.go b/official/docs/golang/current/tax-identifiers/create.go index d004a782..516798ef 100644 --- a/official/docs/golang/current/tax-identifiers/create.go +++ b/official/docs/golang/current/tax-identifiers/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") toAddress, _ := client.GetAddress("adr_...") diff --git a/official/docs/golang/current/trackers/create.go b/official/docs/golang/current/trackers/create.go index 51a63a35..08289f5d 100644 --- a/official/docs/golang/current/trackers/create.go +++ b/official/docs/golang/current/trackers/create.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") tracker, _ := client.CreateTracker( diff --git a/official/docs/golang/current/trackers/list.go b/official/docs/golang/current/trackers/list.go index 0a31884c..a5cddde4 100644 --- a/official/docs/golang/current/trackers/list.go +++ b/official/docs/golang/current/trackers/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") trackers, _ := client.ListTrackers( diff --git a/official/docs/golang/current/trackers/retrieve.go b/official/docs/golang/current/trackers/retrieve.go index e100952f..2a471d7c 100644 --- a/official/docs/golang/current/trackers/retrieve.go +++ b/official/docs/golang/current/trackers/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") tracker, _ := client.GetTracker("trk_...") diff --git a/official/docs/golang/current/users/retrieve.go b/official/docs/golang/current/users/retrieve.go index 0373201c..2eac9d9b 100644 --- a/official/docs/golang/current/users/retrieve.go +++ b/official/docs/golang/current/users/retrieve.go @@ -6,14 +6,14 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") // Retrieve the authenticated user user, _ := client.RetrieveMe() + fmt.Println(user) // Retrieve a child user user, _ = client.GetUser("user_...") - fmt.Println(user) } diff --git a/official/docs/golang/current/users/update.go b/official/docs/golang/current/users/update.go index 6db55136..1032cac2 100644 --- a/official/docs/golang/current/users/update.go +++ b/official/docs/golang/current/users/update.go @@ -6,13 +6,15 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func update() { client := easypost.New("EASYPOST_API_KEY") - user, _ = client.UpdateUser( + rechargeAmount := "50.00" + + user, _ := client.UpdateUser( &easypost.UserOptions{ ID: "user_...", - RechargeAmount: "50.00", + RechargeAmount: &rechargeAmount, }, ) diff --git a/official/docs/golang/current/webhooks/create.go b/official/docs/golang/current/webhooks/create.go index 22f83012..95704911 100644 --- a/official/docs/golang/current/webhooks/create.go +++ b/official/docs/golang/current/webhooks/create.go @@ -6,12 +6,12 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func create() { client := easypost.New("EASYPOST_API_KEY") webhook, _ := client.CreateWebhookWithDetails( &easypost.CreateUpdateWebhookOptions{ - URL: "example.com", + URL: "example.com", WebhookSecret: "A1B2C3", }, ) diff --git a/official/docs/golang/current/webhooks/delete.go b/official/docs/golang/current/webhooks/delete.go index 8fe2f6bb..f6b66156 100644 --- a/official/docs/golang/current/webhooks/delete.go +++ b/official/docs/golang/current/webhooks/delete.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func delete() { client := easypost.New("EASYPOST_API_KEY") err := client.DeleteWebhook("hook_...") diff --git a/official/docs/golang/current/webhooks/list.go b/official/docs/golang/current/webhooks/list.go index a83cd031..fd11b526 100644 --- a/official/docs/golang/current/webhooks/list.go +++ b/official/docs/golang/current/webhooks/list.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func list() { client := easypost.New("EASYPOST_API_KEY") webhooks, _ := client.ListWebhooks() diff --git a/official/docs/golang/current/webhooks/retrieve.go b/official/docs/golang/current/webhooks/retrieve.go index d8a5194a..bfa5880a 100644 --- a/official/docs/golang/current/webhooks/retrieve.go +++ b/official/docs/golang/current/webhooks/retrieve.go @@ -6,7 +6,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func retrieve() { client := easypost.New("EASYPOST_API_KEY") webhook, _ := client.GetWebhook("hook_...") diff --git a/official/docs/golang/current/webhooks/update.go b/official/docs/golang/current/webhooks/update.go index 95039a54..5aadad6b 100644 --- a/official/docs/golang/current/webhooks/update.go +++ b/official/docs/golang/current/webhooks/update.go @@ -6,10 +6,13 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func update() { client := easypost.New("EASYPOST_API_KEY") - webhook, _ := client.UpdateWebhook("hook_...") + webhook, _ := client.UpdateWebhook( + "hook_...", + &easypost.CreateUpdateWebhookOptions{}, + ) fmt.Println(webhook) } diff --git a/official/guides/partner-white-label-guide/golang/configure-recharge.go b/official/guides/partner-white-label-guide/golang/configure-recharge.go index 1e0d6224..bcbe32e7 100644 --- a/official/guides/partner-white-label-guide/golang/configure-recharge.go +++ b/official/guides/partner-white-label-guide/golang/configure-recharge.go @@ -4,7 +4,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func configureRecharge() { client := easypost.New("EASYPOST_API_KEY") _, _ = client.RetrieveMe() diff --git a/official/guides/partner-white-label-guide/golang/fund-wallet.go b/official/guides/partner-white-label-guide/golang/fund-wallet.go index cfde9e83..51038d9a 100644 --- a/official/guides/partner-white-label-guide/golang/fund-wallet.go +++ b/official/guides/partner-white-label-guide/golang/fund-wallet.go @@ -4,7 +4,7 @@ import ( "github.com/EasyPost/easypost-go/v4" ) -func main() { +func fundWallet() { client := easypost.New("EASYPOST_API_KEY") _ = client.FundWallet("2000", easypost.PrimaryPaymentMethodPriority) diff --git a/style_guides/golang/.golangci.yml b/style_guides/golang/.golangci.yml index 2d81bcf5..729e862e 100644 --- a/style_guides/golang/.golangci.yml +++ b/style_guides/golang/.golangci.yml @@ -1,8 +1,6 @@ issues: exclude: - - "other declaration of main" - - "redeclared in this block" - - "`main` is unused" + - "is unused" - "github.com/EasyPost/easypost-go" - "undeclared name: `easypost`" - "expected 'package'"