miqt/cmd/genbindings/util.go

30 lines
402 B
Go
Raw Normal View History

package main
import (
2024-09-04 06:07:11 +00:00
"encoding/json"
"fmt"
2024-09-04 06:07:11 +00:00
"log"
"strings"
)
func maybeSuffix(counter int) string {
if counter == 0 {
return ""
}
return fmt.Sprintf("%d", counter+1)
}
func titleCase(s string) string {
return strings.ToUpper(s[0:1]) + s[1:]
}
2024-09-04 06:07:11 +00:00
func prettyPrint(obj interface{}) {
jb, err := json.MarshalIndent(obj, "", " ")
if err != nil {
panic(err)
}
log.Println(string(jb))
}