mirror of
https://github.com/p4gefau1t/trojan-go.git
synced 2024-04-21 12:21:34 +00:00
Fix: option_test data race (#315)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user