sling v1.0.0 Release Notes

    • โž• Added support for receiving and decoding error JSON structs
    • ๐Ÿ“‡ Renamed Sling JsonBody setter to BodyJSON (breaking)
    • ๐Ÿ“‡ Renamed Sling BodyStruct setter to BodyForm (breaking)
    • ๐Ÿ“‡ Renamed Sling fields httpClient, method, rawURL, and header to be internal (breaking)
    • ๐Ÿ”„ Changed Do and Receive to skip response JSON decoding if "application/json" Content-Type is missing
    • ๐Ÿ”„ Changed Sling.Receive(v interface{}) to Sling.Receive(successV, failureV interface{}) (breaking)
      • Previously Receive attempted to decode the response Body in all cases
      • Updated Receive will decode the response Body into successV for 2XX responses or decode the Body into failureV for other status codes. Pass a nil successV or failureV to skip JSON decoding into that value.
      • To upgrade, pass nil for the failureV argument or consider defining a JSON tagged struct appropriate for the API endpoint. (e.g. s.Receive(&issue, nil), s.Receive(&issue, &githubError))
      • To retain the old behavior, duplicate the first argument (e.g. s.Receive(&tweet, &tweet))
    • ๐Ÿ”„ Changed Sling.Do(http.Request, v interface{}) to Sling.Do(http.Request, successV, failureV interface{}) (breaking)
      • See the changelog entry about Receive, the upgrade path is the same.
    • โœ‚ Removed HEAD, GET, POST, PUT, PATCH, DELETE constants, no reason to export them (breaking)