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
  • Methods in Go — receiver and naming conventions

    Go SELF
    22 level,0 lecture
    We break down why Go needs methods on top of functions, what a receiver is in the func signature ( t Task), and how to choose a short, stable name ( t, u, st). We’ll talk about naming so that calls read like phrases ( t. Label(), t. MarkDone()), why Go usually avoids GetX()/ SetX(), and why a “constructor” is a function like NewTask(...), not a method.
    Open
  • Value vs pointer receiver — selection criteria

    Go SELF
    22 level,1 lecture
    We break down how to choose a receiver for methods in Go: when a value receiver ( T) is enough and when you need a pointer receiver ( * T), how state mutation affects API design, why copying “heavy” structs can be expensive, how append in slice fields breaks expectations with a value receiver, what addressability is and why a call like NewTask () . MarkDone () sometimes does not compile. At the end — a cheat sheet with a table, a mermaid flowchart, and a set of common mistakes.
    Open
  • Method set in Go: why T and *T see different methods

    Go SELF
    22 level,2 lecture
    We break down how interfaces and the method set work in Go, why the type T and the pointer * T “see” different sets of methods, how automatic insertion of & works when calling through the dot, and why interface compatibility is checked strictly (without any compiler “guessing”). Using practical examples ( Task, Completer, range), we show typical pitfalls and a robust strategy for choosing receivers.
    Open
  • fmt.Stringer — String() string

    Go SELF
    22 level,3 lecture
    We break down how the fmt . Stringer interface lets Go types define a human-friendly string representation via the String() method, how the fmt package automatically picks up this contract when printing, why a value receiver is usually chosen for String(), how to write a safe String() for enum-like statuses with switch/ default, and which typical mistakes lead to unexpected output or recursion.
    Open
  • Methods on “slice types”: type Items [] Item

    Go SELF
    22 level,4 lecture
    We break down a practical Go technique: how to turn a “plain slice” into a convenient domain API with methods via a named type ( type Items [] Item), what actually gets copied with a value receiver, why mutating elements works differently from changing the length, and how to choose a method style: return a new slice or mutate via * Items. At the end — a cheat sheet 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