Use the following guide to assist in the upgrade process of the easypost-go
library between major versions.
Likelihood of Impact: High
With the transition to v2
, this library must now be imported as follows:
import (
"github.com/EasyPost/easypost-go/v2"
)
Likelihood of Impact: High
Go 1.15 Required
easypost-go now requires Go 1.15 or greater.
Dependencies
All dependencies had minor version bumps.
Likelihood of Impact: Medium
Default timeouts for all HTTP requests are now set to 60 seconds. If you require longer timeouts, you can set them by overriding the defaults:
client := &easypost.Client{
Timeout: 60000,
}
Likelihood of Impact: Medium
The HTTP method used for the GetShipmentRates
endpoint at the API level has changed from POST
to GET
and will only retrieve rates for a shipment instead of regenerating them. A new /rerate
endpoint has been introduced to replace this functionality; In this library, you can now call the RerateShipment
method to regenerate rates. Due to the logic change, the GetShipmentRates
method has been removed since a Shipment inherently already has rates associated.