Skip to content

Instantly share code, notes, and snippets.

@manakuro
Created May 12, 2022 23:31
Show Gist options
  • Save manakuro/28d137c883cd9293ca36018efcaa80ab to your computer and use it in GitHub Desktop.
Save manakuro/28d137c883cd9293ca36018efcaa80ab to your computer and use it in GitHub Desktop.
//go:build ignore
// +build ignore
package main
import (
"entgo.io/ent/entc"
"entgo.io/ent/entc/gen"
"log"
)
func main() {
opts := []entc.Option{
entc.TemplateDir("./template"),
}
if err := entc.Generate("./schema", &gen.Config{
Features: []gen.Feature{
gen.FeatureUpsert,
},
}, opts...); err != nil {
log.Fatalf("Error: failed running ent codegen: %v", err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment