Go tool to modify struct field tags
This release introduces a new titlecase
transformation option. By passing the --transform titlecase
flag, gomodifytags will transform the tags in the form of:
"BaseDomain"` -> `"Base Domain"
See related issue https://github.com/fatih/gomodifytags/issues/65 and the PR introducing this change: https://github.com/fatih/gomodifytags/pull/87
This release adds the new --quiet
flag. When passed, gomodifytags won't output the results to stdout. This flag might be helpful for users who use gomodifytags
for scripting in conjunction with the -w
flag.
This release changes the special keyword to format tag values from $field
to {field}
. It fixes the issue described in:
https://github.com/fatih/gomodifytags/issues/76
Changes included in this release are: https://github.com/fatih/gomodifytags/pull/85
This release includes the changes from the PR: https://github.com/fatih/gomodifytags/pull/64 gomodifytags handles now the following cases:
func test(arg struct {
Field int `json:"field"`
}) {
}
var x *struct {
Field int `json:"field"`
}
var x []struct {
Field int
}
and nested variants : "array of pointers to array of structs".
This release uses flag.CommandLine.Parse()
instead of flag.Parse()
to check for errors during flag parsing. This let us catch re-defined flag names.
Related changes: https://github.com/fatih/gomodifytags/pull/75
The flag --format
was already in use. v1.10.0
introduced a new feature that also provided the --format
flag. This releases changes the flag to --template
.
This release includes a new --format
flag to change a struct tag's values based on the field name. This allows us to generate custom struct tags that don't follow the standard definition listed in https://golang.org/pkg/reflect/#StructTag. For a concrete example checkout the readme: https://github.com/fatih/gomodifytags#formatting-tag-values
Includes the changes from PR: https://github.com/fatih/gomodifytags/pull/69
Removes the vendor/
folder.
Bump github.com/fatih/structtag from v1.0.0 to v1.2.0
Related change: https://github.com/fatih/gomodifytags/pull/70
This release includes the new -field
flag to modify a single field. It only works in conjunction with the -struct
field and is a way to use gomodifytags from the terminal. Editors modify tags based on offset and are capable of editing single fields, hence they don't need this flag.