Can Go functions be embedded in a Template page?

I’ve just recently started working with Go, specifically modifying the Gogs UI to match the requirements of my team’s project. In the environment I’ve been assigned, I currently only have access to the “templates” and “public” folders. Thus I do not have access to any “.go” files.

With the template files I can embed Javascript/jQuery within tags.

I’m wondering if I can do something similar with Go functions - ie. add them directly within a “.tmpl” file? If so, how?

Robert

No, this is not supported. Go template files do not support embedded go code.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.