slack: json: cannot unmarshal string into Go value of type int64

more info coming soon, but get that after calling GetGroupHistory for 1 specific group and then looping thru:

for _, message := range history.Messages

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 18 (8 by maintainers)

Most upvoted comments

@saxsir yep, looks like json.Number will cover both cases: https://play.golang.org/p/75NwTQT-MG

@saxsir his solution fixes it for me too

I’m having same problem. (getting json: cannot unmarshal number into Go value of type string)

How is use json.Number instead of string ? https://golang.org/pkg/encoding/json/#Number

Type json.Number is an alias for string.

http://stackoverflow.com/questions/24480835/go-decoding-json-int-into-string