Skip to content

Replace structtag library#20

Merged
4meepo merged 1 commit into4meepo:mainfrom
alfa-alex:switch-to-alfatraining/structtag
Jul 28, 2025
Merged

Replace structtag library#20
4meepo merged 1 commit into4meepo:mainfrom
alfa-alex:switch-to-alfatraining/structtag

Conversation

@alfa-alex
Copy link
Contributor

Fixes #19.

I realized that the fatih/structtag library used in this project has some functionality that is not needed for tagalign and that can even cause problems. More specifically, it parses the individual Options of a struct tag (e.g., omitempty for json:"foo,omitempty") whilst for tagalign it is sufficient to treat the value of a struct tag as a blob.

One example of where this additional parsing caused problems could be found in #19.

This PR changes the used structtag library to alfatraining/structtag, a fork carefully crafted to support exactly the features tagalign requires and simplifying the handling of struct values. Given that fatih/structtag hasn't received any updates since almost three years (with some open MRs unmerged since 2021/22), I hope this change is acceptable. As you can see in this MR, apart from the import change, there is no change required to the tagalign code.

@alfa-alex
Copy link
Contributor Author

@4meepo PTAL

@alfa-alex
Copy link
Contributor Author

@4meepo, could you take a look and give us an idea of how likely you are to accept this MR and when? We're having an issue with the bug that this MR is fixing. If you object to this PR, we'll have to find another way around it. We won't be able to use golangci-lint then, which would be unfortunate.

@4meepo 4meepo merged commit 86b3f8d into 4meepo:main Jul 28, 2025
@4meepo
Copy link
Owner

4meepo commented Jul 28, 2025

Been working 996 on another project. And I’m truly sorry for forgetting this PR not once, but twice over these past three months. I really appreciate your patience ❤️

@4meepo
Copy link
Owner

4meepo commented Jul 28, 2025

@alfa-alex This PR has been merged, and will be build into golang-ci lint automatically, I think. Check it later.

@alfa-alex
Copy link
Contributor Author

All good. 🙂 Thanks for taking care of this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tag value is removed and set to empty

2 participants