summaryrefslogtreecommitdiff
path: root/bin-src/util
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-09-01 00:33:47 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-09-01 01:45:17 -0600
commitd26030ecbc2d0baa614ff31e8c0c28e98e1d70ab (patch)
tree295604dd1baf4cb3231628b392b530aad16d58cc /bin-src/util
parentf27db0f7772b3d160e0afececc5b30425ebb2d9b (diff)
Use golangci-lint to modernize my Go
Diffstat (limited to 'bin-src/util')
-rw-r--r--bin-src/util/date.go3
-rw-r--r--bin-src/util/html.go1
-rw-r--r--bin-src/util/rfc6962.go13
3 files changed, 8 insertions, 9 deletions
diff --git a/bin-src/util/date.go b/bin-src/util/date.go
index 3b5c457..8599958 100644
--- a/bin-src/util/date.go
+++ b/bin-src/util/date.go
@@ -6,14 +6,17 @@ import (
)
func Date2HTML(t time.Time) template.HTML {
+ //nolint:gosec // false positive, trusted input
return template.HTML(t.Local().Format("<time datetime=\"2006-01-02 15:04:05\" title=\"2006-01-02 15:04:05\">2006-01-02 <span class=time>15:04:05</span></time>"))
}
func DateTime2HTML(t time.Time) template.HTML {
+ //nolint:gosec // false positive, trusted input
return template.HTML(t.Local().Format("<time datetime=\"2006-01-02 15:04:05\">2006-01-02 15:04:05</time>"))
}
func DateTime2ColorHTML(t time.Time) template.HTML {
+ //nolint:gosec // false positive, trusted input
return template.HTML(t.Local().Format("<time class=daily datetime=\"2006-01-02 15:04:05\">2006-01-02 15:04:05</time>"))
}
diff --git a/bin-src/util/html.go b/bin-src/util/html.go
index af2ce60..6cc6072 100644
--- a/bin-src/util/html.go
+++ b/bin-src/util/html.go
@@ -10,5 +10,6 @@ func HTMLCellEscapeString(s string) template.HTML {
if strings.TrimSpace(html) == "" {
html = "&nbsp;"
}
+ //nolint:gosec // false positive, we did escape it
return template.HTML(html)
}
diff --git a/bin-src/util/rfc6962.go b/bin-src/util/rfc6962.go
index 46a531b..f3ac958 100644
--- a/bin-src/util/rfc6962.go
+++ b/bin-src/util/rfc6962.go
@@ -3,24 +3,19 @@ package util
import (
"crypto/x509"
"encoding/asn1"
-
- //"fmt"
- //"os"
)
+//nolint:gochecknoglobals // would be constant
var (
- oidSCTs = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 2}
- oidPrecertificatePoison = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 3}
+ OidSCTs = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 2}
+ OidPrecertificatePoison = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 3}
)
func IsPrecertificate(certX509 *x509.Certificate) bool {
for _, ext := range certX509.Extensions {
- //fmt.Fprintln(os.Stderr, "ext", ext)
- if ext.Id.Equal(oidPrecertificatePoison) {
- //fmt.Fprintln(os.Stderr, "t")
+ if ext.Id.Equal(OidPrecertificatePoison) {
return true
}
}
- //fmt.Fprintln(os.Stderr, "f")
return false
}