You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Used map create some key value pairs. Final key value pair will require a ',' to be finished. Otherwise a syntax error will be prompting on the console. (VS-Code 1.46) This is a bit conflict with other programming languages like javascript when defining key-value pairs. Is it really necessary to add a comma after the last key-value pair with in the map. structMap := map[string]string{ "name": "John", "age": "24", "location": "Colombo" }
What did you expect to see?
No syntax error.
What did you see instead?
'}' should be right after the "Colombo" value in order to prevent from having this syntax error.
The text was updated successfully, but these errors were encountered:
When showing code, please use plain text or a playground link, not an image. Especially not a white-on-black image. Images are hard to read, and they don't support cut-and-paste of text. Code is plain text, so show it as plain text.
In this case the problem appears to be a missing comma at the end of the "location" line, just as the error message says.
Closing because this seems to be expected behavior.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Used map create some key value pairs. Final key value pair will require a ',' to be finished. Otherwise a syntax error will be prompting on the console. (VS-Code 1.46) This is a bit conflict with other programming languages like javascript when defining key-value pairs. Is it really necessary to add a comma after the last key-value pair with in the map.
structMap := map[string]string{ "name": "John", "age": "24", "location": "Colombo" }
What did you expect to see?
No syntax error.
What did you see instead?
'}' should be right after the "Colombo" value in order to prevent from having this syntax error.
The text was updated successfully, but these errors were encountered: