json: cannot unmarshal object into Go value of type []main.ConnectwiseTicket

265 views
Skip to first unread message

logan infranca

unread,
Dec 8, 2021, 12:21:04 PM12/8/21
to golang-nuts
So I am running my .go file to update things but I keep getting this error. Not completly sure why it could be happening. I debuged it and it seems to be happening here.Capture4.PNG
Capture3.PNG

Tamás Gulácsi

unread,
Dec 8, 2021, 1:11:19 PM12/8/21
to golang-nuts
Why on earth does everybody paste screenshots about TEXTs???

Please copy-paste simple text as simple text!
Color does not convey information, only hides.
Your code is readable, but the error message _is_not_.

Brian Candler

unread,
Dec 8, 2021, 2:48:14 PM12/8/21
to golang-nuts
In addition: please can you take the problematic piece of code and boil it down to a simple standalone example in play.golang.org^W go.dev/play/
which reproduces the error - for example, with a static constant string that you're trying to decode, and some structs that you're trying to decode into.  Then it should be clear what's happening.

You've pasted some incomplete code, with no type definitions; and an error message about decoding JSON without showing the JSON you're trying to decode.
Reply all
Reply to author
Forward
0 new messages