golang-web

Solid

Modern Go Web application architecture guide. Use when creating new Go web projects, APIs, or microservices. Covers project structure, tech stack selection, and best practices based on Go standards.

AI & Automation 154 stars 19 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
73
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Go Web Architecture ## Core Principles - **Standard layout** — Follow cmd/internal/pkg convention - **Explicit dependencies** — Wire dependencies in main.go, no globals - **Interface-driven** — Define interfaces where you use them, not where you implement - **Error wrapping** — Wrap errors with context, use error codes - **No backwards compatibility** — Delete, don't deprecate. Change directly - **LiteLLM for LLM APIs** — Use LiteLLM proxy for all LLM integrations --- ## No Backwards Compatibility > **Delete unused code. Change directly. No compatibility layers.** ```go // ❌ BAD: Deprecated function kept around // Deprecated: Use NewUserService instead func CreateUserService() *UserService { ... } // ❌ BAD: Alias for renamed types type OldName = NewName // "for backwards compatibility" // ❌ BAD: Unused parameters func Process(_ context.Context, data Data) { ... } // ✅ GOOD: Just delete and update all usages func NewUserService(repo UserRepository) *UserService { ... } ``` --- ## LiteLLM for LLM APIs > **Use LiteLLM proxy. Don't call provider APIs directly.** ```go // adapters/llm/client.go package llm import ( "github.com/sashabaranov/go-openai" ) // Connect to LiteLLM proxy using OpenAI-compatible SDK func NewClient(cfg Config) *openai.Client { config := openai.DefaultConfig(cfg.APIKey) config.BaseURL = cfg.BaseURL // LiteLLM proxy URL return openai.NewClientWithConfig(config) } ``` --- ## Quick Start ### 1. Initialize Project ```bash mkd...

Details

Author
majiayu000
Repository
majiayu000/spellbook
Created
6 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category