3 ms·
Excellent point! The type systems verify programs' correctness based on given specification. On the other hand, we have formatters. Gofmt does a great job in fo
by mgechev 8y ago
Excellent point! The type systems verify programs' correctness based on given specification. On the other hand, we have formatters. Gofmt does a great job in formatting source code so it's consistent and easy to read.
Somewhere between code formatting and type checking, there's another area which unfortunately doesn't fit in any of these two categories. For example, enforcement of style-related practices fits here but it doesn't necessarily take the entire space. That's a broad spectrum.
Revive let you develop rules which can use the Go's type system to provide style suggestions with a confidence level (just like golint), or even domain-specific rules which aim to automate other parts of the code-review process.
Such rules will often produce warnings (suggestions to developers), rather than compile-time errors.