yoheimuta / go-protoparser

Yet another Go package which parses a Protocol Buffer file (proto2+proto3)
MIT License
166 stars 20 forks source link

Expose error data to external tools. #45

Closed PaulSonOfLars closed 4 years ago

PaulSonOfLars commented 4 years ago

This creates a specific error type which can be used for error handling in other tools (eg protolint) instead of the current fmt.Errorf() setup.

Before merging, it should be decided whether we expect each component (scanner/lexer/parser) to have its own specific error type, or if one is enough. The current design uses a single error type, to avoid extra boilerplate on external tools having to check multiple errors, and because they all seem to return the same (or very similar) data.

Let me know if you have any strong opinions regarding each option.

(And sorry for the large PR, most of it is boilerplate test code that needed editing😅)

yoheimuta commented 4 years ago

I shipped the release v3.5.0.