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

Commenting last entry fails #9

Open
sundarv85 opened this issue May 23, 2018 · 0 comments
Open

Commenting last entry fails #9

sundarv85 opened this issue May 23, 2018 · 0 comments

Comments

@sundarv85
Copy link

When I comment out the last section of a sub object, it fails (where I comment out three). For e.g.

// This is json5 demo
// json5 can write comment in your json
{
  "key" : "Key does not need double quote",
  // json specific
  "of" : "course we can use json as json5",
  "trailing" : "trailing comma is ok",
  "test": {
	"one": {
	  "map": {
	    "name": "world"
	  }
	},
	"two": {
	  "map": {
	    "name": "world"
	  }
	}
	// "three": {
	//   "map": {
	//     "name": "world"
	//   }
	// }	
  }
}

fails with the error

panic: invalid character '/' after object key:value pair

goroutine 1 [running]:
main.check(0x11812c0, 0xc42000a060)
	/test_project/json5/json5.go:12 +0x4a
main.main()
	/test_project/json5/json5.go:24 +0xe6
exit status 2

while, this works (where I comment out two)

// This is json5 demo
// json5 can write comment in your json
{
  "key" : "Key does not need double quote",
  // json specific
  "of" : "course we can use json as json5",
  "trailing" : "trailing comma is ok",
  "test": {
	"one": {
	  "map": {
	    "name": "world"
	  }
	},
	// "two": {
	//   "map": {
	//     "name": "world"
	//   }
	// },
	"three": {
	  "map": {
	    "name": "world"
	  }
	}	
  }
}
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