Skip to content

Commit

Permalink
no need for a body with .Get
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Jan 14, 2025
1 parent 5196643 commit 9cc2257
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions internal/app/cf-terraforming/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ func generateResources() func(cmd *cobra.Command, args []string) {

var (
jsonStructData []interface{}
params map[string]interface{}
result *http.Response
)

Expand All @@ -130,7 +129,7 @@ func generateResources() func(cmd *cobra.Command, args []string) {

client := cloudflare.NewClient()

err := client.Get(context.Background(), endpoint, params, &result)
err := client.Get(context.Background(), endpoint, nil, &result)
if err != nil {
log.Fatalf("failed to fetch API endpoint: %s", err)
}
Expand Down
4 changes: 1 addition & 3 deletions scripts/build-resource-to-endpoint-mapping
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ end

def list_endpoint(v)
operation = v.dig("methods", "list")
if operation.nil?
return nil
end
return nil if operation.nil?

# if we have a hash it means the endpoint has a
# nested structure and we need the `endpoint` value
Expand Down

0 comments on commit 9cc2257

Please sign in to comment.