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
|
||||
enable:
|
||||
- bodyclose
|
||||
- usestdlibvars
|
||||
- deadcode
|
||||
- depguard
|
||||
- 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) {
|
||||
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 {
|
||||
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 {
|
||||
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 {
|
||||
return err
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ type mockDoer struct{}
|
||||
|
||||
func (m *mockDoer) Do(req *http.Request) (*http.Response, error) {
|
||||
return &http.Response{
|
||||
StatusCode: 200,
|
||||
StatusCode: http.StatusOK,
|
||||
Body: io.NopCloser(bytes.NewBufferString(validPayload)),
|
||||
}, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user