Skip to content

Commit 7518582

Browse files
committed
fix lint
1 parent f8635eb commit 7518582

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

modules/migrations/base/error.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@
44

55
package base
66

7-
import "errors"
8-
9-
var (
10-
// ErrRepoNotCreated returns the error that repository not created
11-
ErrRepoNotCreated = errors.New("repository is not created yet")
12-
)
13-
147
// ErrNotSupported represents status if a downloader do not supported something.
158
type ErrNotSupported struct {
169
}
1710

18-
// ErrNotSupported checks if an error is an ErrNotSupported
11+
// IsErrNotSupported checks if an error is an ErrNotSupported
1912
func IsErrNotSupported(err error) bool {
2013
_, ok := err.(ErrNotSupported)
2114
return ok
2215
}
2316

17+
// Error return error message
2418
func (err ErrNotSupported) Error() string {
2519
return "not supported"
2620
}

modules/migrations/base/null_downloader.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,63 @@ import (
99
"net/url"
1010
)
1111

12-
// NullNotifier implements a blank downloader
12+
// NullDownloader implements a blank downloader
1313
type NullDownloader struct {
1414
}
1515

1616
var (
1717
_ Downloader = &NullDownloader{}
1818
)
1919

20-
func (n NullDownloader) SetContext(_ context.Context) {
21-
return
22-
}
20+
// SetContext set context
21+
func (n NullDownloader) SetContext(_ context.Context) {}
2322

23+
// GetRepoInfo returns a repository information
2424
func (n NullDownloader) GetRepoInfo() (*Repository, error) {
2525
return nil, &ErrNotSupported{}
2626
}
2727

28+
// GetTopics return gitlab topics
2829
func (n NullDownloader) GetTopics() ([]string, error) {
2930
return nil, &ErrNotSupported{}
3031
}
3132

33+
// GetMilestones returns milestones
3234
func (n NullDownloader) GetMilestones() ([]*Milestone, error) {
3335
return nil, &ErrNotSupported{}
3436
}
3537

38+
// GetReleases returns releases
3639
func (n NullDownloader) GetReleases() ([]*Release, error) {
3740
return nil, &ErrNotSupported{}
3841
}
3942

43+
// GetLabels returns labels
4044
func (n NullDownloader) GetLabels() ([]*Label, error) {
4145
return nil, &ErrNotSupported{}
4246
}
4347

48+
// GetIssues returns issues according start and limit
4449
func (n NullDownloader) GetIssues(page, perPage int) ([]*Issue, bool, error) {
4550
return nil, false, &ErrNotSupported{}
4651
}
4752

53+
// GetComments returns comments according issueNumber
4854
func (n NullDownloader) GetComments(issueNumber int64) ([]*Comment, error) {
4955
return nil, &ErrNotSupported{}
5056
}
5157

58+
// GetPullRequests returns pull requests according page and perPage
5259
func (n NullDownloader) GetPullRequests(page, perPage int) ([]*PullRequest, bool, error) {
5360
return nil, false, &ErrNotSupported{}
5461
}
5562

63+
// GetReviews returns pull requests review
5664
func (n NullDownloader) GetReviews(pullRequestNumber int64) ([]*Review, error) {
5765
return nil, &ErrNotSupported{}
5866
}
5967

68+
// FormatGitURL return func to add authentification into remote URLs
6069
func (n NullDownloader) FormatGitURL() func(opts MigrateOptions, remoteAddr string) (string, error) {
6170
return func(opts MigrateOptions, remoteAddr string) (string, error) {
6271
if len(opts.AuthToken) > 0 || len(opts.AuthUsername) > 0 {

modules/migrations/gogs.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ type GogsDownloader struct {
6767
password string
6868
}
6969

70+
// SetContext set context
7071
func (g *GogsDownloader) SetContext(ctx context.Context) {
7172
g.ctx = ctx
7273
}
@@ -206,7 +207,8 @@ func (g *GogsDownloader) GetComments(issueNumber int64) ([]*base.Comment, error)
206207
return allComments, nil
207208
}
208209

209-
func (n GogsDownloader) FormatGitURL() func(opts MigrateOptions, remoteAddr string) (string, error) {
210+
// FormatGitURL return func to add authentification into remote URLs
211+
func (g GogsDownloader) FormatGitURL() func(opts MigrateOptions, remoteAddr string) (string, error) {
210212
return func(opts MigrateOptions, remoteAddr string) (string, error) {
211213
if len(opts.AuthToken) > 0 || len(opts.AuthUsername) > 0 {
212214
u, err := url.Parse(remoteAddr)

0 commit comments

Comments
 (0)