Fixed mdox gen errors on command with = inside (common case).#41
Fixed mdox gen errors on command with = inside (common case).#41
= inside (common case).#41Conversation
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
saswatamcode
left a comment
There was a problem hiding this comment.
This looks awesome! ✨ Just some suggestions!
| val := strings.Split(field, "=") | ||
| val := []string{field} | ||
| if i := strings.Index(field, "="); i != -1 { | ||
| val = []string{field[:i], field[i+1:]} |
There was a problem hiding this comment.
Awesome! Now it is only split at first "=". But maybe instead of using Index this can be done with something like,
val := strings.SplitN(field, "=", 2)
This also would only split at first "=" and return slice of length 2. WDYT?🙂
There was a problem hiding this comment.
Tried to use it, but found it confusing why 2 not 1.. (: will try thanks!
There was a problem hiding this comment.
I think 2 is the number of substrings returned...but yes it is not intuitive. This can be skipped then I guess.
|
|
||
| func (t *genCodeBlockTransformer) Close(ctx mdformatter.SourceContext) error { return nil } | ||
|
|
||
| func genGo(ctx context.Context, moduleRoot string, typePath string) ([]byte, error) { |
There was a problem hiding this comment.
I thought this was to be done as mentioned in #23. Do you have something else in mind? 🙂
There was a problem hiding this comment.
I think this part is not clearly understood yet. We don't know yet how it should look.
This snippet was mainly for the beginning to show you and Uche how we might want to do it.
Normally it's not the best to maintain code which is not used (YAGNI) so killed it (:
| echo "test output3" | ||
| ``` | ||
|
|
||
| ```yaml mdox-exec="bash ./testdata/out2.sh --name=queryfrontend.InMemoryResponseCacheConfig" |
There was a problem hiding this comment.
Yea. It was failing for us before
Signed-off-by: Bartlomiej Plotka bwplotka@gmail.com