Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] preserve comments #33

Open
jschaf opened this issue Feb 14, 2023 · 0 comments
Open

[Feature Request] preserve comments #33

jschaf opened this issue Feb 14, 2023 · 0 comments

Comments

@jschaf
Copy link

jschaf commented Feb 14, 2023

First off, super cool library. I use the field alignment govet check, and it's a pain to figure out the optimal struct order manually. With gopium, I was able to get going in ~5 minutes.

I ran the following command:

gopium \
    --walker_regexp='^InvoiceRow' \
    --package_path="$PWD/erp/integrate/gsheet" \
    ast_go erp/integrate/gsheet \
    memory_pack

The struct was successfully reordered to fix the govet field aligment check. However, gopium removed all comments from the struct field. It'd be nice to keep the documentation comments.

Other minor observations. Feel free to ignore. Including since sometimes it's helpful to hear about first-time usage:

  • It took me a while to figure out the correct invocation. The mix of positional commands like the walker and package and flag commands was confusing. I think flags alone might be easier to understand:
gopium \
  --package_path=erp/integrate/gsheet \ # package path should probably be relative to $PWD
  --struct_regexp='^InvoiceRow$' \
  --strategies=memory_pack,strategy2
  • I had to use PWD to target the correct directory since gopium prepends src/.
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

No branches or pull requests

1 participant