GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( a56d9a...3589f7 )
by
unknown
05:49
created

credentials/internal/utils/runtime.go   A

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 23
dl 0
loc 34
rs 10
c 0
b 0
f 0
1
package utils
2
3
import (
4
	"context"
5
	"net"
6
	"time"
7
)
8
9
// Runtime is for setting timeout, proxy and host
10
type Runtime struct {
11
	ReadTimeout    int
12
	ConnectTimeout int
13
	Proxy          string
14
	Host           string
15
	STSEndpoint    string
16
}
17
18
// NewRuntime returns a Runtime
19
func NewRuntime(readTimeout, connectTimeout int, proxy string, host string) *Runtime {
20
	return &Runtime{
21
		ReadTimeout:    readTimeout,
22
		ConnectTimeout: connectTimeout,
23
		Proxy:          proxy,
24
		Host:           host,
25
	}
26
}
27
28
// Timeout is for connect Timeout
29
func Timeout(connectTimeout time.Duration) func(cxt context.Context, net, addr string) (c net.Conn, err error) {
30
	return func(ctx context.Context, network, address string) (net.Conn, error) {
31
		return (&net.Dialer{
32
			Timeout:   connectTimeout,
33
			DualStack: true,
34
		}).DialContext(ctx, network, address)
35
	}
36
}
37