refactor routes,
tronnet/workflows: Static Analysis -- Golang / static-go (push) Successful in 30s

use json encoding for route body parameters,
implement modify user/group/pool operations,
simplify schema by using comon lib struct tags and RequireAll and AtLeastOne helper functions,
properly implement locadb as Backend interface
This commit is contained in:
alu
2026-08-21 20:49:15 +00:00
parent 670f7d4999
commit 4783d79523
13 changed files with 959 additions and 606 deletions
+19
View File
@@ -0,0 +1,19 @@
package localdb
import "reflect"
// MergeNonZero overwrites fields in dst with fields in src iff src is not a zero value.
func MergeNonZero[T any](dst *T, src *T) {
vDst := reflect.ValueOf(dst).Elem()
vSrc := reflect.ValueOf(src).Elem()
for i := 0; i < vDst.NumField(); i++ {
dstField := vDst.Field(i)
srcField := vSrc.Field(i)
// Only set if the field is exported (CanSet) and the source is not a zero value
if dstField.CanSet() && !srcField.IsZero() {
dstField.Set(srcField)
}
}
}