all: gofmt -w -r 'interface{} -> any' .

Updates #9687
This commit is contained in:
Bjørn Erik Pedersen
2022-03-17 22:03:27 +01:00
parent 423594e03a
commit b80853de90
342 changed files with 2118 additions and 2102 deletions

View File

@@ -31,43 +31,43 @@ func New() *Namespace {
type Namespace struct{}
// CSS returns a given string as html/template CSS content.
func (ns *Namespace) CSS(a interface{}) (template.CSS, error) {
func (ns *Namespace) CSS(a any) (template.CSS, error) {
s, err := cast.ToStringE(a)
return template.CSS(s), err
}
// HTML returns a given string as html/template HTML content.
func (ns *Namespace) HTML(a interface{}) (template.HTML, error) {
func (ns *Namespace) HTML(a any) (template.HTML, error) {
s, err := cast.ToStringE(a)
return template.HTML(s), err
}
// HTMLAttr returns a given string as html/template HTMLAttr content.
func (ns *Namespace) HTMLAttr(a interface{}) (template.HTMLAttr, error) {
func (ns *Namespace) HTMLAttr(a any) (template.HTMLAttr, error) {
s, err := cast.ToStringE(a)
return template.HTMLAttr(s), err
}
// JS returns the given string as a html/template JS content.
func (ns *Namespace) JS(a interface{}) (template.JS, error) {
func (ns *Namespace) JS(a any) (template.JS, error) {
s, err := cast.ToStringE(a)
return template.JS(s), err
}
// JSStr returns the given string as a html/template JSStr content.
func (ns *Namespace) JSStr(a interface{}) (template.JSStr, error) {
func (ns *Namespace) JSStr(a any) (template.JSStr, error) {
s, err := cast.ToStringE(a)
return template.JSStr(s), err
}
// URL returns a given string as html/template URL content.
func (ns *Namespace) URL(a interface{}) (template.URL, error) {
func (ns *Namespace) URL(a any) (template.URL, error) {
s, err := cast.ToStringE(a)
return template.URL(s), err
}
// SanitizeURL returns a given string as html/template URL content.
func (ns *Namespace) SanitizeURL(a interface{}) (string, error) {
func (ns *Namespace) SanitizeURL(a any) (string, error) {
s, err := cast.ToStringE(a)
return helpers.SanitizeURL(s), err
}