autofix: types of function parameters can be combined (#6800)

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
deepsource-autofix[bot]
2022-03-06 15:59:45 +08:00
committed by GitHub
parent 3acc13038d
commit 2d609b8b31
10 changed files with 19 additions and 19 deletions

View File

@@ -27,9 +27,11 @@ import (
jsoniter "github.com/json-iterator/go"
)
var defaultSetting = Settings{false, "GogsServer", 60 * time.Second, 60 * time.Second, nil, nil, nil, false}
var defaultCookieJar http.CookieJar
var settingMutex sync.Mutex
var (
defaultSetting = Settings{false, "GogsServer", 60 * time.Second, 60 * time.Second, nil, nil, nil, false}
defaultCookieJar http.CookieJar
settingMutex sync.Mutex
)
// createDefaultCookie creates a global cookiejar to store cookies.
func createDefaultCookie() {
@@ -270,7 +272,7 @@ func (r *Request) getResponse() (*http.Response, error) {
if err != nil {
log.Fatal(err)
}
//iocopy
// iocopy
_, err = io.Copy(fileWriter, fh)
_ = fh.Close()
if err != nil {
@@ -437,7 +439,7 @@ func (r *Request) Response() (*http.Response, error) {
}
// TimeoutDialer returns functions of connection dialer with timeout settings for http.Transport Dial field.
func TimeoutDialer(cTimeout time.Duration, rwTimeout time.Duration) func(ctx context.Context, net, addr string) (c net.Conn, err error) {
func TimeoutDialer(cTimeout, rwTimeout time.Duration) func(ctx context.Context, net, addr string) (c net.Conn, err error) {
return func(ctx context.Context, netw, addr string) (net.Conn, error) {
conn, err := net.DialTimeout(netw, addr, cTimeout)
if err != nil {