Skip to content

Commit ddfcecc

Browse files
committed
code format
1 parent fca6611 commit ddfcecc

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

src/app/apifetch.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ func FetchAPI(url string) (src.SearchList, error) {
1313
if err != nil {
1414
return src.SearchList{
1515
Data: []src.ImageInfo{},
16-
Meta: src.MetaStruct{}},
16+
Meta: src.MetaStruct{},
17+
},
1718
fmt.Errorf("error making HTTP request: %w", err)
18-
1919
}
2020
defer resp.Body.Close()
2121

@@ -25,9 +25,9 @@ func FetchAPI(url string) (src.SearchList, error) {
2525
if err != nil {
2626
return src.SearchList{
2727
Data: []src.ImageInfo{},
28-
Meta: src.MetaStruct{}},
28+
Meta: src.MetaStruct{},
29+
},
2930
fmt.Errorf("error making HTTP request: %w", err)
30-
3131
}
3232

3333
return searchList, nil

src/app/urlparser.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ func GetFullURL(
7777
page int,
7878
categories, purity, sorting, color, query string,
7979
) string {
80+
8081
params := Param{
8182
Page: page,
8283
CTage: src.CTAGS[categories],

src/cmd/root.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import (
44
"fmt"
55
"os"
66

7-
"github.com/coderj001/go-wallheven/src/app"
87
"github.com/spf13/cobra"
8+
9+
"github.com/coderj001/go-wallheven/src/app"
910
)
1011

1112
var (
@@ -27,9 +28,8 @@ var rootCmd = &cobra.Command{
2728
Long: `go-wallhaven: A seamless solution for downloading and managing wallpapers from wallhaven.cc right from your command line`,
2829
Run: func(cmd *cobra.Command, args []string) {
2930
url := app.GetFullURL(page, categories, purity, sorting, colors, query)
30-
fmt.Println(url)
31-
// searchList, _ := app.FetchAPI(url)
32-
// app.Downloader(&searchList)
31+
searchList, _ := app.FetchAPI(url)
32+
app.Downloader(&searchList)
3333
},
3434
}
3535

src/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//nolint:tagliatelle,stylecheck
2-
//This line is ignoring lint checks because it is necessary for my use case.
2+
// This line is ignoring lint checks because it is necessary for my use case.
33

44
package src
55

@@ -97,7 +97,7 @@ func init() {
9797
dir string
9898
)
9999
if err := godotenv.Load(); err == nil {
100-
fmt.Println("Using config file: .env")
100+
log.Println("Using config file: .env")
101101
apikey = os.Getenv("API_KEY")
102102
dir = os.Getenv("DIR")
103103
} else {

0 commit comments

Comments
 (0)