Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
arriven committed Jun 4, 2023
1 parent d8bb046 commit 4a5558b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/job/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ func (g *GlobalConfig) initProxylist(ctx context.Context) error {
if g.proxyURLs != "" || g.proxylist == "" {
return nil
}

proxylist, err := readProxylist(ctx, g.proxylist)
if err != nil {
return err
}

g.proxyURLs = string(proxylist)

return nil
}

Expand Down
2 changes: 2 additions & 0 deletions src/utils/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ func GetProxyFunc(ctx context.Context, params ProxyParams, protocol string) Prox
// We need to dial new proxy on each call
return func(network, addr string) (net.Conn, error) {
selected := proxies[rand.Intn(len(proxies))] //nolint:gosec // Cryptographically secure random not required

u, err := url.Parse(selected)
if err != nil {
selected = params.DefaultProto + "://" + selected

u, err = url.Parse(selected)
if err != nil {
return nil, fmt.Errorf("error building proxy %v: %w", selected, err)
Expand Down

0 comments on commit 4a5558b

Please sign in to comment.