question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

non-anonymous struct regression

See original GitHub issue

The following json works for previous anonymous struct, but not the current non-anonymous structs. I just get undefined.

Would you double-check please? Thx!

{
  "id": "7a305b33-471c-42cf-9baf-f5220dc17180",
  "version": "1.1",
  "name": "Dummy",
  "url": "",
  "tests": [{
    "id": "3cd0b9fa-aba7-4f9a-b278-c5b43fd9b6be",
    "name": "SeleniumIDE",
    "commands": [{
      "id": "39b58390-385c-4a1e-8915-a993f08cc165",
      "comment": "",
      "command": "open",
      "target": "https://www.seleniumhq.org/",
      "targets": [],
      "value": ""
    }, {
      "id": "6458c851-6c8b-4b82-81d6-66eede61fa2f",
      "comment": "Goto \"Projects\"",
      "command": "echo",
      "target": "",
      "targets": [],
      "value": "Test Step 1"
    }, {
      "id": "bf6c20ea-1a4a-4235-969e-d2b04d193a5b",
      "comment": "",
      "command": "click",
      "target": "linkText=Projects",
      "targets": [
        ["linkText=Projects", "linkText"],
        ["css=a[title=\"Selenium Projects\"]", "css"],
        ["css=#menu_projects > a", "css:finder"],
        ["xpath=//a[contains(text(),'Projects')]", "xpath:link"],
        ["xpath=//li[@id='menu_projects']/a", "xpath:idRelative"],
        ["xpath=//a[contains(@href, '/projects/')]", "xpath:href"],
        ["xpath=//li[5]/a", "xpath:position"]
      ],
      "value": ""
    }, {
      "id": "b4e645f8-c16d-45a6-8116-c36b90ad3a68",
      "comment": "Goto \"Selenium IDE\"",
      "command": "echo",
      "target": "",
      "targets": [],
      "value": "Test Step 2"
    }, {
      "id": "ec99567d-e01b-46f8-b773-9a963ef9cc67",
      "comment": "Get into https://www.seleniumhq.org/selenium-ide/",
      "command": "click",
      "target": "linkText=Selenium IDE",
      "targets": [
        ["linkText=Selenium IDE", "linkText"],
        ["css=h3:nth-child(9) > a", "css:finder"],
        ["xpath=//a[contains(text(),'Selenium IDE')]", "xpath:link"],
        ["xpath=//div[@id='mainContent']/div/h3[3]/a", "xpath:idRelative"],
        ["xpath=//a[contains(@href, '/selenium-ide/')]", "xpath:href"],
        ["xpath=//h3[3]/a", "xpath:position"]
      ],
      "value": ""
    }, {
      "id": "d5886005-7d6d-4cbf-b400-1feaebb51546",
      "comment": "Goto \"Doc\"",
      "command": "echo",
      "target": "",
      "targets": [],
      "value": "Test Step 3"
    }, {
      "id": "18dc810f-2753-471c-b304-5ded76b99d60",
      "comment": "Get into https://www.seleniumhq.org/selenium-ide/docs/en/introduction/getting-started/",
      "command": "click",
      "target": "linkText=Docs",
      "targets": [
        ["linkText=Docs", "linkText"],
        ["css=li > a", "css"],
        ["css=li:nth-child(1) > a", "css:finder"],
        ["xpath=//a[contains(text(),'Docs')]", "xpath:link"],
        ["xpath=//a[contains(@href, '/selenium-ide/docs/en/introduction/getting-started')]", "xpath:href"],
        ["xpath=//li/a", "xpath:position"]
      ],
      "value": ""
    }]
  }],
  "suites": [{
    "id": "ef0df0fa-eb97-4d88-9e8c-b3aa0be8a687",
    "name": "Default Suite",
    "persistSession": false,
    "parallel": false,
    "timeout": 300,
    "tests": ["3cd0b9fa-aba7-4f9a-b278-c5b43fd9b6be"]
  }],
  "urls": [],
  "plugins": []
}

_Originally posted by @suntong in https://github.com/mholt/json-to-go/issues/35#issuecomment-469879323_

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
mike-hosseinicommented, Mar 6, 2019

No, the output doesn’t look correct. I will look into it.

0reactions
suntongcommented, Mar 5, 2019

Confirmed, I got:

syntax error: unexpected literal `json:"tests"`, expecting type
syntax error: unexpected literal `json:"suites"`, expecting type
Read more comments on GitHub >

github_iconTop Results From Across the Web

Option to generate non-anonymous structs as output · Issue #35 ...
@suntong I looked into this and it doesn't seem to be a regression caused by the flatten option that I added. So it...
Read more >
Regression & Relative Importance - Qualtrics
Relative Importance analysis is the best practice method for regression on survey data, and the default output of regressions performed in Stats iQ....
Read more >
How can I return an anonymous struct in C? - Stack Overflow
What you're returning is a struct without a tag, but since it isn't a member, it is not anonymous. GCC uses the name...
Read more >
accept flexible arrays in struct in unions (c++/71912 - [6/7 regression ...
It just seems unnecessarily complicated. anonctx is set to the > innermost non-anonymous-aggregate class containing the flexible array, > yes?
Read more >
Jason Merrill - Re: [PATCH] accept flexible arrays in struct in unions ...
Re: [PATCH] accept flexible arrays in struct in unions (c++/71912 - [6/7 regression]) ... non-anonymous-aggregate class containing the flexible array, yes?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found