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
  • any / interface{}: when it’s acceptable, and when it’s harmful

    Go SELF
    25 level,0 lecture
    We break down what any is (an alias for interface {}), why it’s “flexibility at the price of surprises”, where any fits (application boundaries, logging, generic containers), and where it breaks your model and creates hidden contracts. Separately, we discuss the nil trap inside an interface and the risks of map[any]... with non-comparable keys.
    Open
  • Type assertion v, ok := x.(T) and safe patterns

    Go SELF
    25 level,1 lecture
    We break down how to safely “pull out” a concrete type from an interface in Go via type assertion v , ok := x .( T ): when you need the ok check, why the form without ok is dangerous (panic), how to verify behavior via interfaces ( fmt.Stringer, “temporary” errors), and what pitfalls are related to T vs *T and nil. At the end: typical mistakes and readability criteria.
    Open
  • Type switch in Go: choosing a branch

    Go SELF
    25 level,2 lecture
    We break down how to use type switch in Go to branch on the actual dynamic type of a value stored inside an interface ( any, error): the syntax switch x .( type ), command dispatching, handling multiple types in a single case, interface-based branches (for example, fmt.Stringer), the case nil vs typed nil trap, why branch order matters, and common mistakes.
    Open
  • Typed errors in Go: error structure, Error(), and Unwrap()

    Go SELF
    25 level,3 lecture
    We break down why Go needs typed errors (struct-based errors), how to design their fields and the Error() method, how value receivers and pointer receivers differ when implementing the error interface, and how to wrap underlying causes correctly via Unwrap() so that errors.Is and errors.As work. We build an error chain using a mini app example (“tasker”) and discuss common design mistakes.
    Open
  • Extracting context with errors.As

    Go SELF
    25 level,4 lecture
    We break down how, at the application boundary (CLI/HTTP), to turn any error into a stable UX message without losing diagnostic context: wrapping with fmt.Errorf using %w, the cause chain via Unwrap(), searching for typed errors with errors.As (and why & target is required), plus an example mini task tracker with ValidationError, OpError, NotFoundError, and conversion to UserError.
    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