bobg / modver

MIT License
19 stars 6 forks source link

Suggestion for `modver` output #7

Closed navid-public closed 2 years ago

navid-public commented 2 years ago

To help with readability:

Patchlevel: 
handleRequest: old and new versions of parameters of are not identical:

    Details:
    in type github.com/lib/CustomType: 
        in parameters of 
            func(a *CustomType, path string) error: 
                handleRequest

            struct{
                field1 string
            } 
jcline commented 2 years ago

It'd also be great to support some sort of structured output (e.g. json) for working with other tools.

bobg commented 2 years ago

There is now a -pretty option to the modver command (and a Pretty function in the package) for rendering results and their explanations on multiple lines, with indentation. Sample output:

checking Pretty
  in parameters of func(out io.Writer, res github.com/bobg/modver/v2.Result)
    new interface github.com/bobg/modver/v2.Result does not implement old
      Major

(That result was from an interim version of this module, and the "major" change was reverted, so the current change is only "minor.")

I couldn't think of any suitable structured data to return for @jcline's suggestion, so I'm closing this ticket, but please feel free to open a new one with a more concrete suggestion about that.