Skip to content

Commit

Permalink
Fix race condition between Address() and Serve()
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosNihelton committed Sep 11, 2023
1 parent c36f970 commit 66a0691
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mocks/restserver/restserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ func (s *ServerBase) Stop() error {

// Address returns the server network address configured during Serve. Empty string is returned when called before Serve.
func (s *ServerBase) Address() string {
s.mu.RLock()
defer s.mu.RUnlock()
return s.address
}

Expand Down

0 comments on commit 66a0691

Please sign in to comment.