Skip to content

Instantly share code, notes, and snippets.

@skelterjohn
Created August 4, 2011 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skelterjohn/1125784 to your computer and use it in GitHub Desktop.
Save skelterjohn/1125784 to your computer and use it in GitHub Desktop.
func Redirect(wr io.Writer, data interface{}) {
switch data.(type) {
case ElementA:
templateA.Execute(wr, data)
case ElementB:
templateB.Execute(wr, data)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment