Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksherron committed Feb 3, 2020
1 parent ddaa0df commit 5869a67
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 87 deletions.
1 change: 0 additions & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ func workerN() int {

}


func maxmindPath() string {
maxmindFile := "GeoLite2-Country.mmdb"
f := filepath.Join(dataHome(), maxmindFile)
Expand Down
8 changes: 3 additions & 5 deletions internal/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var (
checkedProxies Proxies
counter int64
realIP string
wgDB sync.WaitGroup
wgDB sync.WaitGroup
wgC sync.WaitGroup
wgLoop sync.WaitGroup
// Workers controls number of max goroutines at a time for checking proxies.
Expand Down Expand Up @@ -326,7 +326,7 @@ func CheckInit() {
if atomic.CompareAndSwapInt64(&counter, limit, 0) {
wgC.Wait()
wgDB.Add(1)
go storeCheckedProxies()
go storeCheckedProxies()

}
}
Expand All @@ -336,7 +336,7 @@ func CheckInit() {
wgC.Wait()
}
wgDB.Add(1)
go storeCheckedProxies()
go storeCheckedProxies()
wgDB.Wait()

if Progress {
Expand All @@ -358,5 +358,3 @@ func storeCheckedProxies() {
dbInsert(proxy)
}
}


38 changes: 19 additions & 19 deletions internal/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ import (
)

var (
mutex = &sync.Mutex{}
busy bool
wgD sync.WaitGroup
reader io.ReadCloser
mutex = &sync.Mutex{}
busy bool
wgD sync.WaitGroup
reader io.ReadCloser
DownloadTimeout time.Duration
)

Expand Down Expand Up @@ -156,7 +156,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := FreeproxylistsP(ctx)
results := freeproxylistsP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -165,7 +165,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := WebanetlabsP(ctx)
results := webanetlabsP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -183,7 +183,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := ProxyListP(ctx)
results := proxyListP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -192,7 +192,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := AliveproxyP(ctx)
results := aliveproxyP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -201,7 +201,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := KuaidailiP(ctx)
results := kuaidailiP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -210,7 +210,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := FeiyiproxyP(ctx)
results := feiyiproxyP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -219,7 +219,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := YipP(ctx)
results := yipP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -228,7 +228,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := Ip3366P(ctx)
results := ip3366P(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -237,7 +237,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := ProxylistMeP(ctx)
results := proxylistMeP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -246,7 +246,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := ProxylistDownloadP(ctx)
results := proxylistDownloadP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -255,7 +255,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := BlogspotP(ctx)
results := blogspotP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -264,7 +264,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := ProxP(ctx)
results := proxP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -273,7 +273,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := MyProxyP(ctx)
results := myProxyP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -282,7 +282,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := XseoP(ctx)
results := xseoP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand All @@ -291,7 +291,7 @@ func DownloadProxies() Proxies {
defer wgD.Done()
ctx, cancel := context.WithTimeout(context.Background(), ctxTimeout)
defer cancel()
results := GithubClarketmP(ctx)
results := githubClarketmP(ctx)
mutex.Lock()
providerProxies = append(providerProxies, results...)
mutex.Unlock()
Expand Down
30 changes: 15 additions & 15 deletions internal/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (
templateProxy = "http://${ip}:${port}\n"
)

func FreeproxylistsP(ctx context.Context) Proxies {
func freeproxylistsP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -104,7 +104,7 @@ func FreeproxylistsP(ctx context.Context) Proxies {
}
}

func WebanetlabsP(ctx context.Context) Proxies {
func webanetlabsP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -231,7 +231,7 @@ func CheckerproxyP(ctx context.Context) Proxies {
}
}

func ProxyListP(ctx context.Context) Proxies {
func proxyListP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -287,7 +287,7 @@ func ProxyListP(ctx context.Context) Proxies {
}
}

func AliveproxyP(ctx context.Context) Proxies {
func aliveproxyP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -358,7 +358,7 @@ func AliveproxyP(ctx context.Context) Proxies {
}
}

func FeiyiproxyP(ctx context.Context) Proxies {
func feiyiproxyP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -398,7 +398,7 @@ func FeiyiproxyP(ctx context.Context) Proxies {

}

func YipP(ctx context.Context) Proxies {
func yipP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -470,7 +470,7 @@ func YipP(ctx context.Context) Proxies {
}
}

func Ip3366P(ctx context.Context) Proxies {
func ip3366P(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -542,7 +542,7 @@ func Ip3366P(ctx context.Context) Proxies {
}
}

func KuaidailiP(ctx context.Context) Proxies {
func kuaidailiP(ctx context.Context) Proxies {
start := time.Now()
var (
largest int
Expand Down Expand Up @@ -620,7 +620,7 @@ func KuaidailiP(ctx context.Context) Proxies {
}
}

func ProxylistMeP(ctx context.Context) Proxies {
func proxylistMeP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -703,7 +703,7 @@ func ProxylistMeP(ctx context.Context) Proxies {
}
}

func ProxylistDownloadP(ctx context.Context) Proxies {
func proxylistDownloadP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -742,7 +742,7 @@ func ProxylistDownloadP(ctx context.Context) Proxies {
}
}

func BlogspotP(ctx context.Context) Proxies {
func blogspotP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -814,7 +814,7 @@ func BlogspotP(ctx context.Context) Proxies {
}
}

func ProxP(ctx context.Context) Proxies {
func proxP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -872,7 +872,7 @@ func ProxP(ctx context.Context) Proxies {
}
}

func MyProxyP(ctx context.Context) Proxies {
func myProxyP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -929,7 +929,7 @@ func MyProxyP(ctx context.Context) Proxies {
}
}

func XseoP(ctx context.Context) Proxies {
func xseoP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down Expand Up @@ -970,7 +970,7 @@ func XseoP(ctx context.Context) Proxies {
}
}

func GithubClarketmP(ctx context.Context) Proxies {
func githubClarketmP(ctx context.Context) Proxies {
defer ctx.Done()
start := time.Now()
var (
Expand Down
Loading

0 comments on commit 5869a67

Please sign in to comment.