Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/admin_auth_ldap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func TestAddLdapBindDn(t *testing.T) {
},
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
assert.FailNow(t, "getAuthSourceByID called", "case %d: should not call getAuthSourceByID", n)
return nil, nil
return nil, nil //nolint:nilnil // mock function covering improper behavior
},
}

Expand Down Expand Up @@ -463,7 +463,7 @@ func TestAddLdapSimpleAuth(t *testing.T) {
},
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
assert.FailNow(t, "getAuthSourceById called", "case %d: should not call getAuthSourceByID", n)
return nil, nil
return nil, nil //nolint:nilnil // mock function covering improper behavior
},
}

Expand Down
14 changes: 7 additions & 7 deletions services/migrations/onedev.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ type OneDevDownloader struct {
}

// NewOneDevDownloader creates a new downloader
func NewOneDevDownloader(_ context.Context, baseURL *url.URL, username, password, repoPath string) *OneDevDownloader {
func NewOneDevDownloader(ctx context.Context, baseURL *url.URL, username, password, repoPath string) *OneDevDownloader {
httpTransport := NewMigrationHTTPTransport()
downloader := &OneDevDownloader{
baseURL: baseURL,
repoPath: repoPath,
client: &http.Client{
Transport: &http.Transport{
Proxy: func(req *http.Request) (*url.URL, error) {
if len(username) > 0 && len(password) > 0 {
Transport: roundTripperFunc(
func(req *http.Request) (*http.Response, error) {
if username != "" && password != "" {
req.SetBasicAuth(username, password)
}
return nil, nil
},
},
return httpTransport.RoundTrip(req.WithContext(ctx))
}),
},
userMap: make(map[int64]*onedevUser),
milestoneMap: make(map[int64]string),
Expand Down