diff options
author | Iskander Sharipov <iskander.sharipov@intel.com> | 2018-07-11 23:36:55 +0300 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-08-22 22:48:10 +0000 |
commit | 48462bb3c04f34c93689c047d4bc5319bc79b31b (patch) | |
tree | 8453b5c4c419a0c4d0da1344d76e8dd0d1f64d56 /src/html | |
parent | ca8ba0675a5a73b4e0ad8ba1c50e244b793934ee (diff) | |
download | go-48462bb3c04f34c93689c047d4bc5319bc79b31b.tar.gz go-48462bb3c04f34c93689c047d4bc5319bc79b31b.zip |
html/template: use named consts instead of their values
Use defined named constants instead of 0 literal in comparisons.
Found using https://go-critic.github.io/overview.html#namedConst-ref
Change-Id: Ic075cece248f6e51db0b3d9d9eaba7d6409c9eef
Reviewed-on: https://go-review.googlesource.com/123376
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/template/context.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/html/template/context.go b/src/html/template/context.go index 45be3a6a9f..7ab3d1fed6 100644 --- a/src/html/template/context.go +++ b/src/html/template/context.go @@ -48,19 +48,19 @@ func (c context) mangle(templateName string) string { return templateName } s := templateName + "$htmltemplate_" + c.state.String() - if c.delim != 0 { + if c.delim != delimNone { s += "_" + c.delim.String() } - if c.urlPart != 0 { + if c.urlPart != urlPartNone { s += "_" + c.urlPart.String() } - if c.jsCtx != 0 { + if c.jsCtx != jsCtxRegexp { s += "_" + c.jsCtx.String() } - if c.attr != 0 { + if c.attr != attrNone { s += "_" + c.attr.String() } - if c.element != 0 { + if c.element != elementNone { s += "_" + c.element.String() } return s |