mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 09:07:21 +01:00
chore: use stdlib vars in code (#1793)
This commit is contained in:
parent
458c69e179
commit
2a2040c570
@ -38,6 +38,7 @@ linters:
|
|||||||
disable-all: true
|
disable-all: true
|
||||||
enable:
|
enable:
|
||||||
- bodyclose
|
- bodyclose
|
||||||
|
- usestdlibvars
|
||||||
- deadcode
|
- deadcode
|
||||||
- depguard
|
- depguard
|
||||||
- dupl
|
- dupl
|
||||||
|
2
cmd.go
2
cmd.go
@ -416,7 +416,7 @@ func syncList(ctx context.Context, httpClient *http.Client, cmdArgs *parser.Argu
|
|||||||
}
|
}
|
||||||
|
|
||||||
if config.Runtime.Mode.AtLeastAUR() && (len(cmdArgs.Targets) == 0 || aur) {
|
if config.Runtime.Mode.AtLeastAUR() && (len(cmdArgs.Targets) == 0 || aur) {
|
||||||
req, err := http.NewRequestWithContext(ctx, "GET", config.AURURL+"/packages.gz", http.NoBody)
|
req, err := http.NewRequestWithContext(ctx, http.MethodGet, config.AURURL+"/packages.gz", http.NoBody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ type rss struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func PrintNewsFeed(ctx context.Context, client *http.Client, cutOffDate time.Time, bottomUp, all, quiet bool) error {
|
func PrintNewsFeed(ctx context.Context, client *http.Client, cutOffDate time.Time, bottomUp, all, quiet bool) error {
|
||||||
req, err := http.NewRequestWithContext(ctx, "GET", "https://archlinux.org/feeds/news", http.NoBody)
|
req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://archlinux.org/feeds/news", http.NoBody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ type mockDoer struct{}
|
|||||||
|
|
||||||
func (m *mockDoer) Do(req *http.Request) (*http.Response, error) {
|
func (m *mockDoer) Do(req *http.Request) (*http.Response, error) {
|
||||||
return &http.Response{
|
return &http.Response{
|
||||||
StatusCode: 200,
|
StatusCode: http.StatusOK,
|
||||||
Body: io.NopCloser(bytes.NewBufferString(validPayload)),
|
Body: io.NopCloser(bytes.NewBufferString(validPayload)),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user