1
0
Fork 0
mirror of https://github.com/imjasonh/snoop synced 2026-07-19 07:04:01 +00:00

fix staticcheck

Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
Jason Hall 2026-01-14 15:57:48 -05:00
parent 6cc13a35c4
commit 1fe85ea6e8
2 changed files with 4 additions and 3 deletions

View file

@ -73,7 +73,7 @@ func (c *Config) Validate() error {
// Validate report path is writable (check directory exists and is writable)
if c.ReportPath != "" {
dir := c.ReportPath
var dir string
// Get directory path
if lastSlash := strings.LastIndex(c.ReportPath, "/"); lastSlash >= 0 {
dir = c.ReportPath[:lastSlash]

View file

@ -5,6 +5,7 @@ import (
"net/http"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
@ -82,8 +83,8 @@ func New() *Metrics {
)
// Register default process metrics (CPU, memory, etc.)
registry.MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}))
registry.MustRegister(prometheus.NewGoCollector())
registry.MustRegister(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}))
registry.MustRegister(collectors.NewGoCollector())
return m
}