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
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"encoding/json"
)
// Client ..
@ -35,7 +35,10 @@ func (client *Client) Getquote() ([]Quote, error) {
var quote Quote
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)
}

View File

@ -1,11 +1,12 @@
package finnhub
import (
"fmt"
"fmt"
"testing"
)
func TestFinnhubClient(t *testing.T){
testClient := &Client {
func TestFinnhubClient(t *testing.T) {
testClient := &Client{
symbols: []string{
"AAPL",
"MSFT",
@ -21,4 +22,4 @@ func TestFinnhubClient(t *testing.T){
fmt.Println(r[0].Stock, r[0].C)
fmt.Println(r[1].Stock, r[1].C)
}
}

View File

@ -9,4 +9,4 @@ type Quote struct {
T int `json:"t"`
Stock string
}
}

View File

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