Finished up Send Message generation

This commit is contained in:
2025-04-26 16:44:48 +02:00
parent 2e081d7690
commit f8577dc3dc
4 changed files with 11 additions and 4 deletions
+7 -1
View File
@@ -71,7 +71,8 @@ type CStyleData struct {
func CreateCStyle(proto *Proto) (string, error) {
funcs := template.FuncMap{
"snake": toSnakeCase,
"snake": toSnakeCase,
"isLast": isLast,
}
tmpl, err := template.New("all").Funcs(funcs).ParseGlob("templates/*.tmpl")
@@ -134,3 +135,8 @@ func toSnakeCase(str string) string {
}
return string(out)
}
// just a helper function, pass the length of your array and your current index
func isLast(datalen int, index int) bool {
return index == datalen-1
}