You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
Weidong Lian
weidonglian
I’m a software developer specializing in Game Development, Music Players, 3D Rendering & Visualization in Stockholm.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Golang Practices: Patterns for "plugin" Package Layouts
wise choices for plugin patterns in golang
Any time you use an interface, really -- if it's a small one, you might cram everything into one package.
If it's not small... you need to decide how to lay out your packaging!
Phase 1: Declare interfaces and API data types in a top level package
Put all the interfaces (and, any other structures that are completely shared data types and part of the general API) in one package.
This is the stuff that most of your program is referring to already, so this is a process of making those boundaries explicit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters