summaryrefslogtreecommitdiff
path: root/internal/llm/anthropic_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-29 20:29:00 +0200
committerPaul Buetow <paul@buetow.org>2026-01-29 20:29:00 +0200
commit40eb437f4826f69ce96cc30656a753519251cc4a (patch)
treef77e7d5d74271c3211342f413b2cb8eff421749f /internal/llm/anthropic_test.go
parentc6bb463837ec8c41261604e416aeab023663ba09 (diff)
refactor: apply code style best practices to Anthropic implementation
- Reorganize anthropic.go: types, interface checks, constructor, public methods, private methods - Extract helper methods from Chat() and ChatStream() to keep functions under 50 lines - Add resolveOptions(), sendRequest(), extractContent() private methods - Add explicit interface satisfaction check for Client and Streamer - Add documentation comments to all public methods (Chat, Name, DefaultModel, ChatStream) - Apply gofmt and gofumpt formatting - Apply goimports for import ordering All 51 tests in llm package pass All code adheres to best practices from go-projects.md: - Value semantics (value receivers only) - Constructors before methods - Public before private - Functions under 50 lines - Explicit interface satisfaction - Documentation on all public identifiers - Proper error handling - Context as first parameter for I/O functions Amp-Thread-ID: https://ampcode.com/threads/T-019c0af1-f215-72cf-9940-b014b1a9576b Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/llm/anthropic_test.go')
-rw-r--r--internal/llm/anthropic_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/llm/anthropic_test.go b/internal/llm/anthropic_test.go
index 15756f5..578b536 100644
--- a/internal/llm/anthropic_test.go
+++ b/internal/llm/anthropic_test.go
@@ -118,7 +118,7 @@ func TestAnthropicChat_EmptyResponse(t *testing.T) {
ID: "msg-123",
Type: "message",
StopReason: "end_turn",
- Content: []struct {
+ Content: []struct {
Type string `json:"type"`
Text string `json:"text"`
}{},