//go:generate go run generate.go
generate go run generate.go
// go : generate go run generate . go
func main() {
	for _, class := range []string{templates.Meter, templates.Charger, templates.Vehicle} {
		path := fmt.Sprintf("%s/%s", basePath, class)
		_, err := os.Stat(path)
		if os.IsNotExist(err) {
			if err := os.MkdirAll(path, 0755); err != nil {
				panic(err)
			}
		}
		if err := clearDir(path); err != nil {
			fmt.Printf("Could not clear directory for %s: %s\n", class, err)
		}
		if err := generateClass(class); err != nil {
			panic(err)
		}
	}
}
func main ( ) { for _ , class := range [ ] string { templates . Meter , templates . Charger , templates . Vehicle } { path := fmt . Sprintf ( " " , basePath , class ) _ , err := os . Stat ( path ) if os . IsNotExist ( err ) { if err := os . MkdirAll ( path , 0755 ) ; err != nil { panic ( err ) } } if err := clearDir ( path ) ; err != nil { fmt . Printf ( " \n " , class , err ) } if err := generateClass ( class ) ; err != nil { panic ( err ) } } }
generate go run generate.go
generate go run generate . go