mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 06:23:59 +08:00
add chapter 15.7 (#683)
This commit is contained in:
18
eBook/examples/chapter_15/pipeline1.go
Normal file
18
eBook/examples/chapter_15/pipeline1.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// pipeline1.go
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
func main() {
|
||||
t := template.New("template test")
|
||||
t = template.Must(t.Parse("This is just static text. \n{{\"This is pipeline data - because it is evaluated within the double braces.\"}} {{`So is this, but within reverse quotes.`}}\n"))
|
||||
t.Execute(os.Stdout, nil)
|
||||
}
|
||||
|
||||
/*
|
||||
This is just static text.
|
||||
This is pipeline data - because it is evaluated within the double braces. So is this, but within reverse quotes.
|
||||
*/
|
Reference in New Issue
Block a user