用$转换模板到模板

I am looking for simple method to convert simple template with ${myvar} to GO template with {{ myvar }}.

Is there any library to achieve that?

Use regex find \${([a-z0-9\_\-]+)} and replace with {{\1}}

You can actually configure your own delimiters. See here: https://golang.org/pkg/text/template/#Template.Delims

So, you should be able to configure prefix as "${" and suffix as "}". Then you should be able to keep using ${myvar} format.

If you prefer to use a regexp to find and replace them, then you regexp should be a little bit more complicated. At the very least it should allow spaces and dots in addition to those proposed. But I'd suggest investigating non greedy replacements instead. See here for an example.