Go character and string literals: regular (‘), double (“) and back-tick (`) quotes
Posted by jpluimers on 2020/10/01
For my link archive:
- single quotes are for “Rune” literals [WayBack]
- double quotes and back-tick quotes are for “String” literals [WayBack]
- [WayBack] go – What is the difference between backticks (“) & double quotes (“”) in golang? – Stack Overflow
- [WayBack] go – What is the usage of backtick in golang structs definition? – Stack Overflow
Back-ticks can be very useful for instance when you need to specifying json tags.
References for that:
- [WayBack] encoding/json – The Go Programming Language
- [WayBack] reflection – What are the use(s) for tags in Go? – Stack Overflow
–jeroen
Leave a Reply