Maintain proper package organization by following established structural patterns and separation of concerns. Code should be organized into appropriate packages based on functionality and responsibility.
Maintain proper package organization by following established structural patterns and separation of concerns. Code should be organized into appropriate packages based on functionality and responsibility.
Key organizational principles:
pkg/modules/
, not in integrations/
or other generic folderspkg/types/
with appropriate sub-packages (e.g., cachetypes
, quickfiltertypes
)New
functions within the types packageExample of proper organization:
// pkg/types/tracefunnel/tracefunnel.go - Type definitions
type Funnel struct { ... }
// pkg/modules/tracefunnel/module.go - Interface declaration
type Module interface { ... }
// pkg/modules/tracefunnel/impltracefunnel/module.go - Implementation
type module struct { ... }
// pkg/modules/tracefunnel/tracefunneltest/mocks.go - Test mocks
type MockModule struct { ... }
This organization improves code maintainability, prevents circular dependencies, and makes the codebase more navigable for developers.
Enter the URL of a public GitHub repository