How to convert escape characters in HTML tags?
How can we directly convert "\u003chtml\u003e" to "<html>" ? Conversion of "<html>" to "\u003chtml\u003e" is quite easy using json.Marshal() , but json.Unmarshal() is quite lengthy and cumbersome. Is there any direct way to do that in golang? You can use the strconv.Unquote() to do the conversion. One thing you should be aware of is that strconv.Unquote() can only unquote strings that are in quotes (e.g. start and end with a quote char " or a back quote char ` ), so we have to manually append that. Example: // Important to use backtick ` (raw string literal) // else the compiler will unquote