1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

fix go lint

This commit is contained in:
Jade 2020-10-19 01:07:04 +01:00
parent 5c6833a0df
commit d152a8beee
4 changed files with 12 additions and 8 deletions

View File

@ -1,10 +1,10 @@
package finnhub package finnhub
import ( import (
"encoding/json"
"fmt" "fmt"
"net/http" "net/http"
"net/url" "net/url"
"encoding/json"
) )
// Client .. // Client ..
@ -35,7 +35,10 @@ func (client *Client) Getquote() ([]Quote, error) {
var quote Quote var quote Quote
quote.Stock = s quote.Stock = s
json.NewDecoder(resp.Body).Decode(&quote) err = json.NewDecoder(resp.Body).Decode(&quote)
if err != nil {
return quotes, err
}
quotes = append(quotes, quote) quotes = append(quotes, quote)
} }

View File

@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
) )
func TestFinnhubClient(t *testing.T) { func TestFinnhubClient(t *testing.T) {
testClient := &Client{ testClient := &Client{
symbols: []string{ symbols: []string{

View File

@ -42,7 +42,7 @@ func (widget *Widget) Refresh() {
func (widget *Widget) content() (string, string, bool) { func (widget *Widget) content() (string, string, bool) {
quotes, err := widget.Client.Getquote() quotes, err := widget.Client.Getquote()
title := fmt.Sprintf("%s", widget.CommonSettings().Title) title := widget.CommonSettings().Title
var str string var str string
wrap := false wrap := false
if err != nil { if err != nil {