JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • defer — argument evaluation timing and LIFO order

    Go SELF
    18 level,0 lecture
    We break down defer in Go: why it is useful with multiple returns, when deferred calls run, why arguments are captured immediately, and why the calls themselves execute in LIFO order. With examples, we will see pitfalls with loops and closures, and build a simple mental model of the “defer stack” so you can predict output without surprises.
    Open
  • Guaranteed resource release

    Go SELF
    18 level,1 lecture
    We break down how to reliably release resources in Go using defer: the correct order “acquire → check err → schedule cleanup”, why it is important not to forget Close () and Unlock (), what to do with an error from Close (), when errors.Join is appropriate, and what pitfalls await when using defer inside loops.
    Open
  • panic vs error — where panic is acceptable and where it is harmful

    Go SELF
    18 level,2 lecture
    In Go, we break down the difference between panic and error: which problems are considered “expected” and should be returned as errors, and which ones indicate a broken invariant and may justify a panic. Using a learning example of a CLI calculator, we will reinforce the (T, error) contract, look at common runtime panics (slices, nil map, division by zero), and discuss where the Must style fits.
    Open
  • recover in a deferred function

    Go SELF
    18 level,3 lecture
    We break down how recover() works in Go and why it only makes sense inside defer: how to catch panic at the application boundary, build a safe main pattern via safeRun(), convert a panic value into a neat error, and (if needed) print a stack trace using debug.Stack(). At the end, we cover common mistakes when using panic/ recover.
    Open
  • Boundaries of responsibility: recover

    Go SELF
    18 level,4 lecture
    We break down where recover is truly appropriate in Go: why it should be placed only at the application boundary (often in main()/ safeRun()), how to distinguish expected errors ( error) from “impossible” situations ( panic), and why recover inside business logic turns into a dangerous anti-pattern. At the end, there’s a practical checklist and common mistakes.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush