Skip to content

Commit

Permalink
swap booleans to pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz authored Nov 20, 2024
1 parent ea51d51 commit d11c2e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions leaked_credential_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
type LeakedCredentialCheckGetStatusParams struct{}

type LeakedCredentialCheckStatus struct {
Enabled bool `json:"enabled"`
Enabled *bool `json:"enabled"`
}

type LeakCredentialCheckStatusResponse struct {
Expand All @@ -20,7 +20,7 @@ type LeakCredentialCheckStatusResponse struct {
}

type LeakCredentialCheckSetStatusParams struct {
Enabled bool `json:"enabled"`
Enabled *bool `json:"enabled"`
}

type LeakedCredentialCheckListDetectionsParams struct{}
Expand Down
4 changes: 2 additions & 2 deletions leaked_credential_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestLeakedCredentialCheckGetStatus(t *testing.T) {
mux.HandleFunc("/zones/"+testZoneID+"/leaked-credential-checks", handler)

want := LeakedCredentialCheckStatus{
Enabled: true,
Enabled: BoolPtr(true),
}
actual, err := client.LeakedCredentialCheckGetStatus(context.Background(), ZoneIdentifier(testZoneID), LeakedCredentialCheckGetStatusParams{})
if assert.NoError(t, err) {
Expand All @@ -53,7 +53,7 @@ func TestLeakedCredentialCheckSetStatus(t *testing.T) {
mux.HandleFunc("/zones/"+testZoneID+"/leaked-credential-checks", handler)

want := LeakedCredentialCheckStatus{
Enabled: false,
Enabled: BoolPtr(false),
}
actual, err := client.LeakedCredentialCheckSetStatus(context.Background(), ZoneIdentifier(testZoneID), LeakCredentialCheckSetStatusParams{false})

Check failure on line 58 in leaked_credential_check_test.go

View workflow job for this annotation

GitHub Actions / test (1.20)

cannot use false (untyped bool constant) as *bool value in struct literal

Check failure on line 58 in leaked_credential_check_test.go

View workflow job for this annotation

GitHub Actions / test (1.21)

cannot use false (untyped bool constant) as *bool value in struct literal

Check failure on line 58 in leaked_credential_check_test.go

View workflow job for this annotation

GitHub Actions / test (1.22)

cannot use false (untyped bool constant) as *bool value in struct literal
if assert.NoError(t, err) {
Expand Down

0 comments on commit d11c2e9

Please sign in to comment.