INNER CODE UNIT · Go
Codify
krisnova/naml · codify.go:108
func Codify(input io.Reader, v *CodifyValues) ([]byte, error) {
if v.PackageName == "" {
return []byte(""), fmt.Errorf("missing packageName")
}
var code []byte
// Setup template with a unique name based on the input
tpl := template.New(fmt.Sprintf("%+v%+v", input, v.AppNameLower))
// Create the base file
templateString := FormatMainGo
if v.LibraryMode {
templateString = FormatLibraryGo
}
tpl, err := tpl.Parse(templateString)
if err != nil {