Skip to content

Instantly share code, notes, and snippets.

@yosssi
Created August 5, 2014 15:27
Show Gist options
  • Select an option

  • Save yosssi/2e2d7ed8a2394aa8bc1a to your computer and use it in GitHub Desktop.

Select an option

Save yosssi/2e2d7ed8a2394aa8bc1a to your computer and use it in GitHub Desktop.
[Ace] Default Value Example
html
head
= include inc "aaa"
= include inc "bbb"
= include inc
meta name=description content={{or . "default value"}}
package main
import (
"os"
"github.com/yosssi/ace"
)
func main() {
tpl, err := ace.Load("base", "", nil)
if err != nil {
panic(err)
}
if err := tpl.Execute(os.Stdout, nil); err != nil {
panic(err)
}
}
<html>
<head>
<meta name="description" content="aaa">
<meta name="description" content="bbb">
<meta name="description" content="default value">
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment