You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We often sed to point to certain structure. This is fragile as whenever code changes file, or lines were added before or structure adds or removes lines we have to manually find A - B in `sed -n 'A,,Bp'
It would be easy to just point to struct you want to print in whole package or module 🤗
The text was updated successfully, but these errors were encountered:
I have the same need, and for a PR in custom-metrics-apiserver (kubernetes-sigs/custom-metrics-apiserver#138), I developed a small tool that prints snippets of Go files, to be used with mdox-exec.
I would be happy to use it to contribute it to mdox, as @dgrisonnet suggested.
Is the following syntax suitable?
```go mdox-go-file="main.go" mdox-go-snippets="type=MyStruct,func=main"
// it would print the type MyStruct and the main function (in that order) from main.go
```
However, I'm not sure having this (or having mdox-gen-go-struct in #60) really complies with Unix philosophy (do one thing, do it well)...
I think this would fit well here, and addresses the sed fragility really well. I would love to see this addition! 🙂
I think mdox aims to fit really well with Go ecosystem in general, so we started initiatives like #60. Wdyt? cc: @bwplotka
We often sed to point to certain structure. This is fragile as whenever code changes file, or lines were added before or structure adds or removes lines we have to manually find
A
-B
in `sed -n 'A,,Bp'It would be easy to just point to struct you want to print in whole package or module 🤗
The text was updated successfully, but these errors were encountered: