Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in OperationCompletionSuccessfulOptions #19

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions nexus/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ type OperationCompletionSuccessful struct {
Body io.Reader
}

// OperationCompletionSuccesfulOptions are options for [NewOperationCompletionSuccessful].
type OperationCompletionSuccesfulOptions struct {
// OperationCompletionSuccessfulOptions are options for [NewOperationCompletionSuccessful].
type OperationCompletionSuccessfulOptions struct {
// Optional serializer for the result. Defaults to the SDK's default Serializer, which handles JSONables, byte
// slices and nils.
Serializer Serializer
}

// NewOperationCompletionSuccessful constructs an [OperationCompletionSuccessful] from a given result.
func NewOperationCompletionSuccessful(result any, options OperationCompletionSuccesfulOptions) (*OperationCompletionSuccessful, error) {
func NewOperationCompletionSuccessful(result any, options OperationCompletionSuccessfulOptions) (*OperationCompletionSuccessful, error) {
if reader, ok := result.(*Reader); ok {
return &OperationCompletionSuccessful{
Header: addContentHeaderToHTTPHeader(reader.Header, make(http.Header)),
Expand Down
4 changes: 2 additions & 2 deletions nexus/completion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestSuccessfulCompletion(t *testing.T) {
ctx, callbackURL, teardown := setupForCompletion(t, &successfulCompletionHandler{}, nil)
defer teardown()

completion, err := NewOperationCompletionSuccessful(666, OperationCompletionSuccesfulOptions{})
completion, err := NewOperationCompletionSuccessful(666, OperationCompletionSuccessfulOptions{})
completion.Header.Add("foo", "bar")
require.NoError(t, err)

Expand All @@ -60,7 +60,7 @@ func TestSuccessfulCompletion_CustomSerializr(t *testing.T) {
ctx, callbackURL, teardown := setupForCompletion(t, &successfulCompletionHandler{}, serializer)
defer teardown()

completion, err := NewOperationCompletionSuccessful(666, OperationCompletionSuccesfulOptions{
completion, err := NewOperationCompletionSuccessful(666, OperationCompletionSuccessfulOptions{
Serializer: serializer,
})
completion.Header.Add("foo", "bar")
Expand Down
Loading