mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
fix go lint
This commit is contained in:
parent
5c6833a0df
commit
d152a8beee
@ -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("e)
|
||||
err = json.NewDecoder(resp.Body).Decode("e)
|
||||
if err != nil {
|
||||
return quotes, err
|
||||
}
|
||||
quotes = append(quotes, quote)
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -9,4 +9,4 @@ type Quote struct {
|
||||
T int `json:"t"`
|
||||
|
||||
Stock string
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user