Go Templates

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • t, err := template.Parse({{.MyName .MyAge}})

  • t.Execute(os.Stdout,struct{MyValue,MyAge string}{"John Doe","40.1"})

Remarks

Golang provides packages like:

  1. text/template

  2. html/template

to implement data-driven templates for generating textual and HTML outputs.



Got any Go Question?