From 8127a3620c2330c9bd3219c7a0ee7bd656c80708 Mon Sep 17 00:00:00 2001 From: nicksherron Date: Wed, 5 Feb 2020 04:27:45 -0500 Subject: [PATCH] internal/providers: fix race conditions --- internal/check.go | 4 ++-- internal/providers_test.go | 2 -- main.go | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/internal/check.go b/internal/check.go index dfd177e..7b3f0d0 100644 --- a/internal/check.go +++ b/internal/check.go @@ -61,7 +61,7 @@ var ( resolveCount int ) -func resolveJudges() { +func resolveJudges() { suffix := "/get?show_env" sites := []string{ @@ -84,7 +84,7 @@ func resolveJudges() { var limit int - if Workers < 100 { + if Workers < 100 { limit = Workers } else { limit = 100 diff --git a/internal/providers_test.go b/internal/providers_test.go index 116332a..41af30c 100644 --- a/internal/providers_test.go +++ b/internal/providers_test.go @@ -30,7 +30,6 @@ var ( // TODO: Not sure if these are very idiomatic. Maybe use test table for providers instead of separate functions but still perform each test regardless of success. - func TestUsProxyP(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) defer cancel() @@ -49,7 +48,6 @@ func TestUsProxyP(t *testing.T) { } } - func TestKuaidailiP(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) defer cancel() diff --git a/main.go b/main.go index bb995f5..83c97c1 100644 --- a/main.go +++ b/main.go @@ -1,8 +1,6 @@ package main -import ( - "github.com/nicksherron/proxi/cmd" -) +import "github.com/nicksherron/proxi/cmd" func main() { cmd.Execute()