Skip to content

Commit

Permalink
Merge pull request #64 from k1LoW/clear
Browse files Browse the repository at this point in the history
Add methods for clearing
  • Loading branch information
k1LoW authored Oct 30, 2023
2 parents ebed5a1 + 9181dcb commit 2245c32
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Run lint
uses: reviewdog/action-golangci-lint@v2
with:
fail_on_error: true
golangci_lint_flags: --timeout=5m

- name: Run tests
run: make ci
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tagpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version-file: go.mod

Expand Down
11 changes: 11 additions & 0 deletions grpcstub.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,17 @@ func (s *Server) UnmatchedRequests() []*Request {
return s.unmatchedRequests
}

// ClearMatchers clear matchers.
func (s *Server) ClearMatchers() {
s.matchers = nil
}

// ClearRequests clear requests.
func (s *Server) ClearRequests() {
s.requests = nil
s.unmatchedRequests = nil
}

// Requests returns []*grpcstub.Request received by matcher.
func (m *matcher) Requests() []*Request {
m.mu.RLock()
Expand Down

0 comments on commit 2245c32

Please sign in to comment.