I have some code that looks like
Id string // uniq bid req id provided by the exchange
Fields []interface{} // array of field objects
User interface{} // user obj
Device interface{}
I know about the align-regexp
function, and I use this to align my comments. This would output something like
Id string // uniq bid req id provided by the exchange
Fields []interface{} // array of field objects
User interface{} // user obj
Device interface{}
However, I would also like the types to be aligned properly. I was trying to figure out how I would be able to use align-regexp
in order to accomplish this. Unfortunately, my regex skills are lacking.
I would like the output to look like
Id string // uniq bid req id provided by the exchange
Fields []interface{} // array of field objects
User interface{} // user obj
Device interface{}
I wouldn't mind if this was two separate function calls, as I could just write a function that could encapsulate them.
Also, I don't care if the solution ends up using align-regexp
. This is just what I have been using for things like this thus far.