fixgen is a tool for generating fixture packages for tools like yo, ent.
go install github.com/earlgray283/fixgen@latestYou can start generating by specifying the tool name after fixgen.
fixgen yo| Option Name | Flag | Default Value | Description |
|---|---|---|---|
| Prefix | --prefix |
<null> |
prefix for names of generated Go files |
| Extension | --ext |
.gen.go |
extension for names of generated Go files |
| PackageName | --package |
fixture |
package name for generated Go files |
| Output | --output |
. |
destination directory(if DestDir is foo and PackageName is var, then the directory foo/var will be created) |
| SkipConfirm | --skip-confirm |
false |
skip confirm before generation |
| UseContext | --use-context |
false |
if true, context.Context argument will be added to fixture function |
| UseValueModifier | --use-value-modifier |
false |
if true, type of modifier struct will be value |
| Config | --config |
fixgen.yaml |
location of fixgen configration file |
See example
| Tool Name | Repository URL |
|---|---|
| yo | https://github.com/cloudspannerecosystem/yo |
| ent | https://github.com/ent/ent |