Skip to content

Commit 392984c

Browse files
fix lint error
1 parent f1b0237 commit 392984c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/clients/googlebooks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ func (c *GoogleBooksClient) Search(query string, limit int, tr bool) ([]*models.
103103
var year *int
104104
if len(vi.PublishedDate) >= 4 {
105105
y := 0
106-
fmt.Sscanf(vi.PublishedDate[:4], "%d", &y)
107-
if y > 0 {
106+
_, err := fmt.Sscanf(vi.PublishedDate[:4], "%d", &y)
107+
if err == nil && y > 0 {
108108
year = &y
109109
}
110110
}

0 commit comments

Comments
 (0)