mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-22 08:04:18 +02:00
Merge 631f7e7469 into 53788271b3
This commit is contained in:
commit
6578484cda
3 changed files with 3 additions and 5 deletions
|
|
@ -23,12 +23,11 @@ func findGitHubREADME(u *url.URL) (*source, error) {
|
|||
|
||||
apiURL := fmt.Sprintf("https://api.%s/repos/%s/%s/readme", u.Hostname(), owner, repo)
|
||||
|
||||
//nolint:bodyclose
|
||||
// it is closed on the caller
|
||||
res, err := http.Get(apiURL) //nolint: gosec,noctx
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to get url: %w", err)
|
||||
}
|
||||
defer res.Body.Close() //nolint:bodyclose
|
||||
|
||||
body, err := io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -25,12 +25,11 @@ func findGitLabREADME(u *url.URL) (*source, error) {
|
|||
|
||||
apiURL := fmt.Sprintf("https://%s/api/v4/projects/%s", u.Hostname(), projectPath)
|
||||
|
||||
//nolint:bodyclose
|
||||
// it is closed on the caller
|
||||
res, err := http.Get(apiURL) //nolint: gosec,noctx
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to get url: %w", err)
|
||||
}
|
||||
defer res.Body.Close() //nolint:bodyclose
|
||||
|
||||
body, err := io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
|
|
|
|||
2
main.go
2
main.go
|
|
@ -432,7 +432,7 @@ func tryLoadConfigFromDefaultPlaces() {
|
|||
scope := gap.NewScope(gap.User, "glow")
|
||||
dirs, err := scope.ConfigDirs()
|
||||
if err != nil {
|
||||
fmt.Println("Could not load find configuration directory.")
|
||||
fmt.Println("Could not find configuration directory.")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue