Skip to content
This repository has been archived by the owner on Feb 27, 2020. It is now read-only.

Something bad happened: json: cannot unmarshal array into Go struct field General.CoinName of type string #4

Closed
nifflin opened this issue Jan 26, 2018 · 0 comments
Labels

Comments

@nifflin
Copy link
Contributor

nifflin commented Jan 26, 2018

package main

import (
"fmt"

"github.com/lucazulian/cryptocomparego"
"github.com/lucazulian/cryptocomparego/context"
    )

func main() {

client := cryptocomparego.NewClient(nil)
ctx := context.TODO()

socialStats, _, err := client.SocialStats.Get(ctx, "iota")

if err != nil {
	fmt.Printf("Something bad happened: %s\n", err)
	return
}

fmt.Printf("Stats %+v\n", socialStats)
fmt.Printf("General Name %s\n", socialStats.General.Name)

for _, similarItem := range socialStats.CryptoCompare.SimilarItems {
	fmt.Printf("Similar Item %s\n", similarItem.Name)
}
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants