Skip to content

Commit

Permalink
Merge pull request #74 from perrito666/add_prefix_to_column_name_tag
Browse files Browse the repository at this point in the history
Rename `format` to `template` to avoid clash
  • Loading branch information
fatih committed Oct 22, 2020
2 parents 45c5830 + 5d50608 commit 66ed821
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -157,11 +157,11 @@ form: `json:"server"` (assuming `-add-tags=json` is used).

However, some third party libraries use tags in a different way and might
require to them to have a particular formatting, such as is the case of
prefixing them (`field_name=<your_value>`). The `--format` flag allows you to
prefixing them (`field_name=<your_value>`). The `--template` flag allows you to
specify a custom format for the tag value to be applied.

```
$ gomodifytags -file demo.go -struct Server -add-tags gaum -format "field_name=$field"
$ gomodifytags -file demo.go -struct Server -add-tags gaum -template "field_name=$field"
```

```go
Expand Down
2 changes: 1 addition & 1 deletion main.go
Expand Up @@ -115,7 +115,7 @@ func realMain() error {
"Sort sorts the tags in increasing order according to the key name")

// formatting
flagFormatting = flag.String("format", "",
flagFormatting = flag.String("template", "",
"Format the given tag's value. i.e: \"column:$field\", \"field_name=$field\"")

// option flags
Expand Down

0 comments on commit 66ed821

Please sign in to comment.