feat: add gen enum command

This commit is contained in:
Rogee
2024-12-19 15:00:58 +08:00
parent 797ff49fc7
commit 80ab62534d
15 changed files with 2674 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
//go:build go1.18
// +build go1.18
package generator
// SumIntsOrFloats sums the values of map m. It supports both int64 and float64
// as types for map values.
func SumIntsOrFloats[K comparable, V int64 | float64](m map[K]V) V {
var s V
for _, v := range m {
s += v
}
return s
}
// ChangeType is a type of change detected.
/* ENUM(
Create
Update
Delete
) */
type ChangeType int