minor udate

This commit is contained in:
2026-01-24 15:45:25 +11:00
parent 0c13e37743
commit e7801afd07
2 changed files with 2 additions and 2 deletions

View File

@@ -116,7 +116,7 @@ import (
**Files**: **Files**:
- Prefer single word: `config.go`, `oauth.go`, `errors.go` - Prefer single word: `config.go`, `oauth.go`, `errors.go`
- Use snake_case if needed: `discord_tokens.go`, `state_test.go` - Don't use snake_case except for tests: `state_test.go`
- Test files: `*_test.go` alongside source files - Test files: `*_test.go` alongside source files
### Error Handling ### Error Handling
@@ -143,6 +143,7 @@ func DoSomething(cfg *Config, data string) error {
``` ```
**HTTP error helpers** (in handlers package): **HTTP error helpers** (in handlers package):
*Note: `msg` should be a frontend presentable message*
- `throwInternalServiceError(s, w, r, msg, err)` - 500 errors - `throwInternalServiceError(s, w, r, msg, err)` - 500 errors
- `throwBadRequest(s, w, r, msg, err)` - 400 errors - `throwBadRequest(s, w, r, msg, err)` - 400 errors
- `throwForbidden(s, w, r, msg, err)` - 403 errors (normal) - `throwForbidden(s, w, r, msg, err)` - 403 errors (normal)
@@ -215,7 +216,6 @@ func ConfigFromEnv() (any, error) {
**Formatting**: **Formatting**:
- Use `gofmt` (standard Go formatting) - Use `gofmt` (standard Go formatting)
- No tabs vs spaces debate - Go uses tabs
**Types**: **Types**:
- Prefer explicit types over inference when it improves clarity - Prefer explicit types over inference when it improves clarity