Finished up Send Message generation
This commit is contained in:
+7
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user