Skip to content

Commit

Permalink
Merge pull request #525 from fastly/fgsch/more-types
Browse files Browse the repository at this point in the history
Extend ToPointer to cover []string
  • Loading branch information
fgsch authored May 14, 2024
2 parents 76c09dd + 89f0c58 commit 48a8f39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fastly/health_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ func TestClient_HealthChecks(t *testing.T) {
ServiceVersion: *tv.Number,
Name: ToPointer("test-healthcheck"),
Method: ToPointer("HEAD"),
Headers: &[]string{
Headers: ToPointer([]string{
"Foo: Bar",
"Baz: Qux",
},
}),
Host: ToPointer("example.com"),
Path: ToPointer("/foo"),
HTTPVersion: ToPointer("1.1"),
Expand Down Expand Up @@ -169,7 +169,7 @@ func TestClient_HealthChecks(t *testing.T) {
ServiceVersion: *tv.Number,
Name: "test-healthcheck",
NewName: ToPointer("new-test-healthcheck"),
Headers: &[]string{"Beep: Boop"},
Headers: ToPointer([]string{"Beep: Boop"}),
})
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion fastly/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package fastly

// MultiConstraint is a generic constraint for ToPointer/ToValue.
type MultiConstraint interface {
~string | ~int | int32 | ~int64 | uint | uint8 | uint32 | uint64 | float64 | ~bool
[]string | ~string | ~int | int32 | ~int64 | uint | uint8 | uint32 | uint64 | float64 | ~bool
}

// ToPointer converts T to *T.
Expand Down

0 comments on commit 48a8f39

Please sign in to comment.