Skip to content

Commit 26ab71d

Browse files
committed
fix formatting
1 parent e263147 commit 26ab71d

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

cmd/root.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ Useful if you are lazy to open up a browser to download e-books/resources.`,
1818
}
1919

2020
var versionCmd = &cobra.Command{
21-
Use: "version",
22-
Short: "Print the version number of Hugo",
23-
Long: `All software has versions. This is Hugo's`,
24-
Run: func(cmd *cobra.Command, args []string) {
25-
fmt.Println(version)
26-
},
21+
Use: "version",
22+
Short: "Print the version number of Hugo",
23+
Long: `All software has versions. This is Hugo's`,
24+
Run: func(cmd *cobra.Command, args []string) {
25+
fmt.Println(version)
26+
},
2727
}
2828

2929
func Execute() {
@@ -34,5 +34,5 @@ func Execute() {
3434
}
3535

3636
func init() {
37-
rootCmd.AddCommand(versionCmd)
37+
rootCmd.AddCommand(versionCmd)
3838
}

internal/document_parser/legacy_document.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ func GetDirectDownloadLinkFromLegacy(link string, linkType string) string {
108108

109109
page := NewLegacyDocumentParserFromReader(resp.Body)
110110

111-
var directDownloadLink string
112-
var exists bool
113-
114-
if (linkType == "faster") {
115-
directDownloadLink, exists = page.getFasterDownloadLinkFromDocument()
116-
} else {
117-
directDownloadLink, exists = page.getDownloadLinkFromDocument()
118-
}
111+
var directDownloadLink string
112+
var exists bool
113+
114+
if linkType == "faster" {
115+
directDownloadLink, exists = page.getFasterDownloadLinkFromDocument()
116+
} else {
117+
directDownloadLink, exists = page.getDownloadLinkFromDocument()
118+
}
119119

120120
fmt.Printf("[%s] Direct download link: [%s]\n", linkType, directDownloadLink)
121121

internal/downloader/downloader.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type Downloader struct {
1818
selectedBook book.Book
1919
directLink string
2020
outputFileDir string
21-
linkType string;
21+
linkType string
2222
}
2323

2424
func NewDownloader(selectedBook book.Book, directLink string, outputFileDir string) *Downloader {
@@ -55,9 +55,9 @@ func (d *Downloader) Download() error {
5555

5656
bytes, err := io.Copy(io.MultiWriter(f, bar), resp.Body)
5757

58-
// Check if byte size is unusually low
58+
// Check if byte size is unusually low
5959
if bytes <= 200 || err != nil {
60-
fmt.Println(console.Error("File downloaded with unusually low bytes size: %d bytes", bytes))
60+
fmt.Println(console.Error("File downloaded with unusually low bytes size: %d bytes", bytes))
6161
} else {
6262
fmt.Println(console.Success("File successfully downloaded: %s", f.Name()))
6363
}

internal/mirror/legacy_mirror.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func NewLegacyMirror(domain libgen.Domain) *LegacyMirror {
3131
}
3232

3333
func (m *LegacyMirror) SetNumberOfResults(numberOfResults int) {
34-
m.config.numberOfResults = numberOfResults
34+
m.config.numberOfResults = numberOfResults
3535
}
3636

3737
func (m *LegacyMirror) SearchByTitle(query string) ([]book.Book, error) {
@@ -82,7 +82,6 @@ func (m *LegacyMirror) SearchByISBN(isbn string) ([]book.Book, error) {
8282
return bookResults, err
8383
}
8484

85-
8685
func (m *LegacyMirror) SearchByAuthor(query string) ([]book.Book, error) {
8786
fmt.Println("Searching by author: ", console.Higlight(query))
8887
document, err := m.searchSite(query, libgen.AUTHOR)

0 commit comments

Comments
 (0)