Skip to content

Commit

Permalink
fix: Lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alexluong committed Sep 15, 2023
1 parent cd612eb commit 403231e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion internal/provider/connection/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ func transformFilterRuleProperty(property *filterRuleProperty) *hookdeck.FilterR
// parse string to JSON
var jsonData map[string]any
jsonBytes := []byte(property.JSON.ValueString())
json.Unmarshal(jsonBytes, &jsonData)
if err := json.Unmarshal(jsonBytes, &jsonData); err != nil {
return nil
}
return hookdeck.NewFilterRulePropertyFromStringUnknownMapOptional(jsonData)
}
if !property.Number.IsUnknown() && !property.Number.IsNull() {
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/destination/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (m *destinationResourceModel) ToCreatePayload() *hookdeck.DestinationCreate
} else {
httpMethod = nil
}
var pathForwardingDisabled *hookdeckcore.Optional[bool] = nil
var pathForwardingDisabled *hookdeckcore.Optional[bool]
if !m.PathForwardingDisabled.IsUnknown() && !m.PathForwardingDisabled.IsNull() {
pathForwardingDisabled = hookdeck.Optional(m.PathForwardingDisabled.ValueBool())
} else {
Expand Down Expand Up @@ -224,7 +224,7 @@ func (m *destinationResourceModel) refreshAuthMethod(destination *hookdeck.Desti
if destination.AuthMethod.CustomSignature != nil {
m.AuthMethod.CustomSignature = &customSignature{}
m.AuthMethod.CustomSignature.Key = types.StringValue(destination.AuthMethod.CustomSignature.Config.Key)
m.AuthMethod.CustomSignature.SigningSecret = types.StringValue(string(*destination.AuthMethod.CustomSignature.Config.SigningSecret))
m.AuthMethod.CustomSignature.SigningSecret = types.StringValue(*destination.AuthMethod.CustomSignature.Config.SigningSecret)
}

if destination.AuthMethod.HookdeckSignature != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/sourceverification/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (m *sourceVerificationResourceModel) ToCreatePayload() *hookdeck.SourceUpda
}

func (m *sourceVerificationResourceModel) ToUpdatePayload() *hookdeck.SourceUpdateRequest {
var verification *hookdeck.VerificationConfig = nil
var verification *hookdeck.VerificationConfig

// generic
if m.Verification.APIKey != nil {
Expand Down
4 changes: 3 additions & 1 deletion internal/provider/transformation/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ func (m *transformationResourceModel) getENV() map[string]string {
var envData map[string]string = nil
if !m.ENV.IsUnknown() && !m.ENV.IsNull() {
envBytes := []byte(m.ENV.ValueString())
json.Unmarshal(envBytes, &envData)
if err := json.Unmarshal(envBytes, &envData); err != nil {
return nil
}
}
return envData
}

0 comments on commit 403231e

Please sign in to comment.