Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: json: cannot unmarshal array into Go value of type string #3

Closed
meirwah opened this issue Mar 22, 2016 · 0 comments
Closed

error: json: cannot unmarshal array into Go value of type string #3

meirwah opened this issue Mar 22, 2016 · 0 comments

Comments

@meirwah
Copy link
Contributor

meirwah commented Mar 22, 2016

When using Resolve method on url = google.com, you get this issue..
This is because in ResolveResp struct TXT is a string array, but it is actually an array of string arrays.

for instance, this isd the response for "google.com":i

{
  "A": [
    "172.217.2.174"
  ],
  "AAAA": [
    "2607:f8b0:4000:80b::200e"
  ],
  "TXT": [
    [
      "v=spf1 include:_spf.google.com ~all"
    ]
  ],
  "MX": [
    {
      "exchange": "alt1.aspmx.l.google.com",
      "priority": 20
    },
    {
      "exchange": "alt4.aspmx.l.google.com",
      "priority": 50
    },
    {
      "exchange": "alt2.aspmx.l.google.com",
      "priority": 30
    },
    {
      "exchange": "aspmx.l.google.com",
      "priority": 10
    },
    {
      "exchange": "alt3.aspmx.l.google.com",
      "priority": 40
    }
  ],
  "total_rows": 8
}```
@meirwah meirwah mentioned this issue Mar 22, 2016
slavikm added a commit that referenced this issue Mar 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant