Your c2
variable is holding invalid JSON:
c2 := "{" +
`"name" : "silicon",` +
`"mw" : 32.1173,` +
`}` +
`"index" : [` +
` {"name" : "mw", "value" : 32.1173}` +
`]` +
`}`
Cleaned up, it'll look like this:
c2 := `{
"name" : "silicon",
"mw" : 32.1173,
}
"index" : [
{"name" : "mw", "value" : 32.1173}
]
}`
You can see there's an extra }
in the middle.
It should look like this:
c2 := `{
"name": "silicon",
"mw": 32.1173,
"index": [
{
"name": "mw",
"value": 32.1173
}
]
}`