GitShow/fatih/gomodifytags
fatih

gomodifytags

Go tool to modify struct field tags

by fatih
gogolangstructstagstool
Star on GitHubFork

Go

2.4k stars139 forks23 contributorsQuiet · 1y agoSince 2017v1.17.0BSD-3-Clause

Meet the team

See all 23 on GitHub →
fatih
fatih91 contributions
LeGEC
LeGEC3 contributions
madelinekalil
madelinekalil3 contributions
dependabot[bot]Bot
dependabot[bot]3 contributions
perrito666
perrito6662 contributions
zmb3
zmb32 contributions
ramya-rao-a
ramya-rao-a2 contributions
testwill
testwill1 contribution

Languages

View on GitHub →
Go100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
42
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 5 in progress · Last activity 1y ago
See all on GitHub →
james-lawrence
[Feature Request] Add ability to modify tags by field type.OpenIssue

running into an issue where I want to ensure uint64's get the option. unfortunately only way to do this is to enumerate all the uint64 field names and add it. be great if this could just be wholesale done on entire file at once.

james-lawrence · 3mo ago
elzorrorebelde
[Feature request] Means for having different casing in tag nameOpenIssue

I encountered this edge case, say you have this struct transform with : Now, the API offers you its data like this: So, the API returns the web's URL in a field called , but gomodifytags transforms the part of the field "URL" as URL and not as Url. That's okay. Currently, this can be solved by, either: manually modifying the tag name, with the downside that refreshing the tags will overwrite such manual change. changing the name of the field in the struct, with the downside that I prefer , not in my struct field.

elzorrorebelde · 1y ago
CL-Jeremy
Add more case transformationsOpenPR

Add strict versions of PascalCase and camelCase, as well as CONST_CASE from #95, with respective basic test cases. Based on my experience, the former two are used extensively at least in C# and JavaScript/TypeScript. In fact, I don't personally know another language that strongly encourages retaining all caps segments in a camel/pascal-case identifier (DBName rather than DbName) other than Go. Not adding UPPERCASE and lowercase transformations, as the supposed use case referred to by the OP would most probably be achieved by quoting entity names in SQL queries, or using either snake_case (PostgreSQL) or CONST_CASE (SQL standard), so the word boundaries are retained. If anybody does indeed need pure case conversions (could also be that they were using _ in Go identifiers, uhh...), feel free to reply here.

CL-Jeremy · 2y ago

Recent fixes

View closed PRs →
madelinekalil
Make snakecase the default in ApplyMergedPR

Currently, when calling Apply() without providing a Transform value, gomodifytags throws an error "unknown transform option". We should instead have a default value of snakecase, which is consistent with the command line execution of gomodifytags.

madelinekalil · 1y ago
madelinekalil
Remove tag if new tag value is empty.MergedPR

If the new tag value is the empty string, set the Tag to be nil. Having empty but non-nil tags causes formatting issues that leave trailing whitespace.

madelinekalil · 1y ago
fatih
Extract gomodifytags into a libraryMergedPR

This PR moves the tool into its package to be imported by other applications (i.e.: ). It's currently deliberately put under , as I want to make sure it meets the needs of others. related: https://github.com/golang/vscode-go/issues/2002

fatih · 1y ago
Structured data for AI agents

Repository: fatih/gomodifytags. Description: Go tool to modify struct field tags Stars: 2395, Forks: 139. Primary language: Go. Languages: Go (100%). License: BSD-3-Clause. Topics: go, golang, structs, tags, tool. Latest release: v1.17.0 (2y ago). Open PRs: 5, open issues: 8. Last activity: 1y ago. Community health: 42%. Top contributors: fatih, LeGEC, madelinekalil, dependabot[bot], perrito666, zmb3, ramya-rao-a, testwill, brantou, vigo and others.

·@ofershap

Replace github.com with gitshow.dev