Golang html/template.Template.Name and New functions example
package html/template
Name returns the name of the template.
New allocates a new HTML template associated with the given one and with the same delimiters. The association, which is transitive, allows one template to invoke another with a {{template}} action.
Golang html/template.Template.Name and New functions usage example
package main
import (
"fmt"
"html/template"
)
func main() {
t := template.New("HELLO")
fmt.Println("Template name is : ", t.Name())
}
Output :
Template name is : HELLO
References :
Advertisement
Something interesting
Tutorials
+5k Golang : Calculate a pip value and distance to target profit example
+34.6k Golang : How to stream file to client(browser) or write to http.ResponseWriter?
+7.8k Golang : Reverse a string with unicode
+13.6k Golang : Strings comparison
+12.2k Golang : Simple client-server HMAC authentication without SSL example
+5.8k Golang : Markov chains to predict probability of next state example
+16.5k Golang : Get IP addresses of a domain name
+16.9k Golang : Set up source IP address before making HTTP request
+5.4k Javascript : How to loop over and parse JSON data?
+33.6k Golang : How to check if slice or array is empty?
+7.4k Golang : How to detect if a sentence ends with a punctuation?
+7.1k Nginx : How to block user agent ?