|
|
|
@@ -3,7 +3,6 @@ package apiclient |
|
|
|
import ( |
|
|
|
"encoding/json" |
|
|
|
"fmt" |
|
|
|
"io" |
|
|
|
"net/http" |
|
|
|
|
|
|
|
"github.com/AFASystems/presence/internal/pkg/config" |
|
|
|
@@ -17,13 +16,6 @@ func GetTrackers(token string, client *http.Client, cfg *config.Config) ([]model |
|
|
|
return []model.Tracker{}, err |
|
|
|
} |
|
|
|
|
|
|
|
bodyBytes, err := io.ReadAll(res.Body) |
|
|
|
if err != nil { |
|
|
|
fmt.Printf("error read body: %+v\n", err) |
|
|
|
return []model.Tracker{}, err |
|
|
|
} |
|
|
|
fmt.Printf("body: %s\n", string(bodyBytes)) |
|
|
|
|
|
|
|
var i []model.Tracker |
|
|
|
err = json.NewDecoder(res.Body).Decode(&i) |
|
|
|
if err != nil { |
|
|
|
|