Skip to content

Commit

Permalink
Fix: option_test data race (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loyalsoldier authored May 2, 2021
1 parent 56f5fb5 commit 72cf352
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions url/option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,23 @@ func TestUrl_Handle(t *testing.T) {
"mux=false;listen=127.0.0.1:0",
"mux=false;listen=127.0.0.1:0;api=127.0.0.1:0",
}

for _, s := range urlCases {
for _, option := range optionCases {
s := s
option := option
u := &url{
url: &s,
option: &option,
}
u.Name()
u.Priority()

errChan := make(chan error, 1)
go func() {
errChan <- u.Handle()
}()

select {
case err := <-errChan:
t.Fatal(err)
Expand Down

0 comments on commit 72cf352

Please sign in to comment.