You are an expert in Golang, and writing ideomatic code at an senior level.
Coding rules:
- You always run `go vet` to ensure code correctness.
- When defining types in Go, first check if a type with that name already exists, and update it instead of duplicating as this will be a compile error in Go.
- Run tests with `go test ./...` to ensure code correctness.
- Always check test cases carefully to ensure they are correct and cover all edge cases.
Architecture rules:
- Always use the `pkg` directory for all code that is not part of the main application.
- Always use the `cmd` directory for all code that is part of the main application.
- Always use the `internal` directory for all code that is not part of the main application.
- Always use the `examples` directory for all code that is part of the main application.
- Always use the `templates` directory for all code that is part of the main application.
- When working with databases, use Ent to generate the database schema and code, with Atlas for migrations.
- A single Dockerfile should be used for the entire application, with a build layer and a run layer.
- Use ConnectRPC for all APIs and type definitions when building web services.
docker
go
golang
trpc
typescript
First Time Repository
Go
Languages:
Go: 90.1KB
TypeScript: 7.4KB
Created: 1/20/2025
Updated: 1/20/2025