42dx / edgio-go-sdk

Go SDK implementing Edgio's REST API
http://github.42dx.dev/edgio-go-sdk/
MIT License
8 stars 1 forks source link

Refactored GetHttpJSONResult to be more explicit #41

Closed rafapaulin closed 6 months ago

rafapaulin commented 6 months ago

Proposed Changes

Change the implementation of the GetHTTPJSONResult function so that it returns the JSON data returned from the HTTP call as a map that can be, later, typed by the function that uses the util. This way the general implementation ends up clearer and more concise.

Contribution type

Related Issue(s)

Motivation, Context and Extra Info

Currently, GetHTTPJSONResult modifies a var reference to "return" the data retrieved from the HTTP call. This behavior is not ideal, and may lead to poor maintenance/unexpected behavior in the future. Not to mention that it kills the idiomatic go concept.

Checks

General

Code Standards

Documentation and reliability

Testing

How to verify the changes

  1. Unit tests are passing
  2. running main.go should not return any errors, and you should be able to see all types of data implemented so far (Org, property, env and variables)

Screenshots (if appropriate)

N/A

sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

42dx-bot[bot] commented 5 months ago

:tada: This PR is included in version 1.0.0-beta.4 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: