fix: remove unused imports and variables in falldetect/detector.go

Remove unused "math" import, unused startZ/endZ variables, and fix
Position struct json tags to pass go vet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-04-06 18:44:18 -04:00
parent 07db05202f
commit 32bde5c743

View file

@ -6,7 +6,6 @@ package falldetect
import (
"fmt"
"log"
"math"
"sync"
"time"
)
@ -61,7 +60,9 @@ type FallEvent struct {
// Position represents a 3D position.
type Position struct {
X, Y, Z float64 `json:"x,y,z"`
X float64 `json:"x"`
Y float64 `json:"y"`
Z float64 `json:"z"`
}
// BlobSnapshot captures blob state at a point in time.
@ -357,16 +358,13 @@ func (d *Detector) checkForDescent(blob struct {
// Calculate Z velocity over rolling window
windowStart := now.Add(-time.Duration(d.config.DescentWindow * float64(time.Second)))
var startZ, endZ float64
var startFound, endFound bool
for i := len(history) - 1; i >= 0; i-- {
if history[i].Timestamp.After(windowStart) || history[i].Timestamp.Equal(windowStart) {
if !endFound {
endZ = history[i].Z
endFound = true
}
startZ = history[i].Z
startFound = true
} else {
break