ADR-0015: Use Singular Form for File and Package Naming
- Status: accepted
- Date: 2024-11-18
- Tags: Convention, Naming, Go
Context
Our codebase needs consistent naming conventions for Go files and packages. While Go has a strict convention for package names (singular), file naming is less standardized. This inconsistency can lead to maintenance overhead and cognitive load when working with the codebase.
Decision
We will use singular form for both file names and package names unless plural form provides clear additional clarity or disambiguation.
Examples:
entity.go
overentities.go
user.go
overusers.go
config.go
overconfigs.go
Exceptions allowed when:
- Plural form better represents the file’s contents (e.g.,
constants.go
for a file containing only constants) - Disambiguation is needed (e.g.,
users_api.go
vsuser_model.go
)
Consequences
Positive
- Consistent with Go’s package naming convention
- Reduces decision overhead
- Easier maintenance and navigation
- Aligns with Go standard library practices
Negative
- May require renaming existing files
- Some edge cases may require team discussion
- ADR-0021: SPIKE Keeper as a Stateless Shard Holder
- ADR-0020: Switch to Zola for Documentation System
- ADR-0019: Plugin-Based Storage Backend Architecture
- ADR-0018: Administrative Access to SPIKE
- ADR-0017: Synchronous Persistence for SPIKE Secrets Store
- ADR-0016: Memory-First Secrets Store
- ADR-0015: Use Singular Form for File and Package Naming
- ADR-0014: Maintaining SQLite as SPIKE’s Primary Storage Backend
- ADR-0013: S3-Compatible Storage as SPIKE’s Backing Store
- ADR-0012: HTTP Methods for SPIKE API
- ADR-0011: PostgreSQL as SPIKE’s Backing Store
- ADR-0010: Session Token Storage Strategy for SPIKE Nexus
- ADR-0009: Multi-Administrator Support System
- ADR-0008: Administrative Access Control System
- ADR-0007: Root Key Lifecycle and Management Strategy
- ADR-0006: Trust Boundary Definition and Security Assumptions
- ADR-0005: Use SPIFFE mTLS for Inter-Component Authentication and Communication
- ADR-0004: SPIKE Keeper Minimalist Design Approach
- ADR-0003: Root Key Management and Storage Strategy
- ADR-0002: Use Docsify for Documentation System
- ADR-0001: Display Secrets in Plain Text in SPIKE Pilot Admin CLI