Skip to content

Commit

Permalink
Merge pull request #32 from microsoft/fix/pass-request-option-by-ref
Browse files Browse the repository at this point in the history
Adds getter and setter to response handler pointer
  • Loading branch information
baywet committed Sep 14, 2022
2 parents 1134b6b + 44a28cf commit d3af23c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/go.yml
Expand Up @@ -22,3 +22,6 @@ jobs:
- name: Build SDK project
run: go build
working-directory: ${{ env.relativePath }}
- name: Test SDK
run: go test
working-directory: ${{ env.relativePath }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

## [0.10.1] - 2022-09-14

### Changed

- Fix: Add getter and setter on `ResponseHandler` pointer .

## [0.10.0] - 2022-09-02

### Added
Expand Down
12 changes: 6 additions & 6 deletions request_handler_option.go
Expand Up @@ -12,22 +12,22 @@ var ResponseHandlerOptionKey = RequestOptionKey{
}

type requestHandlerOption struct {
responseHandler ResponseHandler
handler ResponseHandler
}

// NewRequestHandlerOption creates a new RequestInformation object with default values.
func NewRequestHandlerOption() RequestHandlerOption {
return &requestHandlerOption{}
}

func (r requestHandlerOption) GetResponseHandler() ResponseHandler {
return r.responseHandler
func (r *requestHandlerOption) GetResponseHandler() ResponseHandler {
return r.handler
}

func (r requestHandlerOption) SetResponseHandler(responseHandler ResponseHandler) {
r.responseHandler = responseHandler
func (r *requestHandlerOption) SetResponseHandler(responseHandler ResponseHandler) {
r.handler = responseHandler
}

func (r requestHandlerOption) GetKey() RequestOptionKey {
func (r *requestHandlerOption) GetKey() RequestOptionKey {
return ResponseHandlerOptionKey
}

0 comments on commit d3af23c

Please sign in to comment.