feat: add exercise templates for 27 Go programming concepts - #5
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds 14 new Go exercises (templates and tests) covering closures, recursion, range, pointers, strings/runes, structs, methods, interfaces, enums, struct embedding, generics, iterators, and errors. Updates catalog to include these exercises. Extends go.mod with additional indirect dependencies (testify, difflib, spew) via a require block. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Lib as IterateInts
participant Ctor as NewIntIterator
participant It as IntIterator
participant Fn as Callback fn(int)
Client->>Lib: IterateInts(start, end, fn)
Lib->>Ctor: NewIntIterator(start, end)
Ctor-->>Lib: *IntIterator
loop while current < end
Lib->>It: Next()
It-->>Lib: (val, ok=true)
Lib->>Fn: fn(val)
end
Lib->>It: Next()
It-->>Lib: (0, ok=false)
Lib-->>Client: return
sequenceDiagram
autonumber
participant Caller as processDivision
participant Div as divide
Caller->>Div: divide(a, b)
alt b == 0
Div-->>Caller: (0, error "division by zero")
Caller-->>Caller: print "Error: %v"
else b != 0
Div-->>Caller: (a/b, nil)
Caller-->>Caller: print "Result: %d"
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (30)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Tip For best results, initiate chat on the files or code changes. @zhravan Hello! I'm here and ready to help. How can I assist you with this PR that adds templates for concepts? Whether you need a review, have questions, or want me to take a specific action, just let me know! ( ᵔ ᴗ ᵔ ) |
|
@coderabbitai give PR title |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 394 🏁 Script executed: Length of output: 5080 @zhravan Based on my analysis of the PR content, I can see that this adds a comprehensive set of exercise templates for learning Go programming concepts. The templates cover 27 different topics from basic concepts like "hello world" to advanced topics like generics and custom errors. Here's my suggested PR title:
Alternative titles you might consider:
The current PR adds templates for fundamental Go concepts including variables, functions, data structures, object-oriented features, and error handling - each with corresponding test files. This creates a solid foundation for a structured Go learning experience. ( ᵔ ᴗ ᵔ ) 🏁 Script executed: Length of output: 824 Perfect! Now I can see the complete picture. These are exercise templates where each function has a TODO comment and intentionally incorrect implementation, designed for students to fix and make the tests pass. Here's my refined PR title suggestion:
This title is concise and accurately describes what's being added - a comprehensive set of hands-on exercise templates that cover the core Go programming curriculum from basic concepts to advanced topics like generics and error handling. ( ᵔ ᴗ ᵔ ) |
Summary by CodeRabbit
New Features
Tests
Chores