Avoid using 'import public' and 'import weak' in Protobuf as these features can introduce unwanted complexity and obscure file dependencies. While 'import public' was intended to simplify package structures, it is tailored for C++ and can cause compatibility issues in other languages like Go. 'Import weak' allows for optional message types, but often leads to buggy implementation and is treated as non-functional by default. Instead, plan file adjustments in future API versions and use Buf lint rules to enforce best practices.

5m read timeFrom mcyoung.xyz
Post cover image
Table of contents
Import VisibilityWeak Imports

Sort: