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
|
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("e)
|
err = json.NewDecoder(resp.Body).Decode("e)
|
||||||
|
if err != nil {
|
||||||
|
return quotes, err
|
||||||
|
}
|
||||||
quotes = append(quotes, quote)
|
quotes = append(quotes, quote)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package finnhub
|
package finnhub
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
func TestFinnhubClient(t *testing.T){
|
|
||||||
testClient := &Client {
|
func TestFinnhubClient(t *testing.T) {
|
||||||
|
testClient := &Client{
|
||||||
symbols: []string{
|
symbols: []string{
|
||||||
"AAPL",
|
"AAPL",
|
||||||
"MSFT",
|
"MSFT",
|
||||||
@ -21,4 +22,4 @@ func TestFinnhubClient(t *testing.T){
|
|||||||
fmt.Println(r[0].Stock, r[0].C)
|
fmt.Println(r[0].Stock, r[0].C)
|
||||||
fmt.Println(r[1].Stock, r[1].C)
|
fmt.Println(r[1].Stock, r[1].C)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,4 +9,4 @@ type Quote struct {
|
|||||||
T int `json:"t"`
|
T int `json:"t"`
|
||||||
|
|
||||||
Stock string
|
Stock string
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user