Skip to content

Commit 403231e

Browse files
committed
fix: Lint issues
1 parent cd612eb commit 403231e

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

internal/provider/connection/sdk.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ func transformFilterRuleProperty(property *filterRuleProperty) *hookdeck.FilterR
111111
// parse string to JSON
112112
var jsonData map[string]any
113113
jsonBytes := []byte(property.JSON.ValueString())
114-
json.Unmarshal(jsonBytes, &jsonData)
114+
if err := json.Unmarshal(jsonBytes, &jsonData); err != nil {
115+
return nil
116+
}
115117
return hookdeck.NewFilterRulePropertyFromStringUnknownMapOptional(jsonData)
116118
}
117119
if !property.Number.IsUnknown() && !property.Number.IsNull() {

internal/provider/destination/sdk.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (m *destinationResourceModel) ToCreatePayload() *hookdeck.DestinationCreate
6363
} else {
6464
httpMethod = nil
6565
}
66-
var pathForwardingDisabled *hookdeckcore.Optional[bool] = nil
66+
var pathForwardingDisabled *hookdeckcore.Optional[bool]
6767
if !m.PathForwardingDisabled.IsUnknown() && !m.PathForwardingDisabled.IsNull() {
6868
pathForwardingDisabled = hookdeck.Optional(m.PathForwardingDisabled.ValueBool())
6969
} else {
@@ -224,7 +224,7 @@ func (m *destinationResourceModel) refreshAuthMethod(destination *hookdeck.Desti
224224
if destination.AuthMethod.CustomSignature != nil {
225225
m.AuthMethod.CustomSignature = &customSignature{}
226226
m.AuthMethod.CustomSignature.Key = types.StringValue(destination.AuthMethod.CustomSignature.Config.Key)
227-
m.AuthMethod.CustomSignature.SigningSecret = types.StringValue(string(*destination.AuthMethod.CustomSignature.Config.SigningSecret))
227+
m.AuthMethod.CustomSignature.SigningSecret = types.StringValue(*destination.AuthMethod.CustomSignature.Config.SigningSecret)
228228
}
229229

230230
if destination.AuthMethod.HookdeckSignature != nil {

internal/provider/sourceverification/sdk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func (m *sourceVerificationResourceModel) ToCreatePayload() *hookdeck.SourceUpda
1212
}
1313

1414
func (m *sourceVerificationResourceModel) ToUpdatePayload() *hookdeck.SourceUpdateRequest {
15-
var verification *hookdeck.VerificationConfig = nil
15+
var verification *hookdeck.VerificationConfig
1616

1717
// generic
1818
if m.Verification.APIKey != nil {

internal/provider/transformation/sdk.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ func (m *transformationResourceModel) getENV() map[string]string {
5151
var envData map[string]string = nil
5252
if !m.ENV.IsUnknown() && !m.ENV.IsNull() {
5353
envBytes := []byte(m.ENV.ValueString())
54-
json.Unmarshal(envBytes, &envData)
54+
if err := json.Unmarshal(envBytes, &envData); err != nil {
55+
return nil
56+
}
5557
}
5658
return envData
5759
}

0 commit comments

Comments
 (0)