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
  • type X struct { ... } — fields, zero values

    Go SELF
    21 level,0 lecture
    We break down structs in Go: how to declare a new type via type … struct, what fields are and how to access them via the selector ., how zero value works (including nil for map/ slice and pointers), how exported and unexported fields differ ( Title vs title), and why you sometimes pass * Task instead of Task.
    Open
  • Struct literals: positional vs named fields

    Go SELF
    21 level,1 lecture
    We break down composite struct literals in Go: how to create values via T{...}, how positional initialization differs from named initialization ( Field : "value"), why positional style is risky during refactoring, how partial initialization and the zero value work, why you cannot mix styles, how to get a pointer via & T{...}, and how to conveniently build slices of structs and multi-line literals (with the required trailing comma).
    Open
  • Comparable structs: when == is allowed, and when it is not

    Go SELF
    21 level,2 lecture
    We break down what “comparable” ( comparable) means in Go: why you can compare a struct via == only when all its fields are comparable, what breaks comparability (for example, slice, map, func), why interface fields are tricky (a panic at runtime is possible), how pointer comparisons ( * T) can be interpreted differently, and why comparability is directly tied to whether a value can be used as a key in a map.
    Open
  • Struct tags — how to read json:"title,omitempty"

    Go SELF
    21 level,3 lecture
    We break down what struct tags are in Go and why they are just string labels for libraries. We learn how to “read” tags like json : "title,omitempty": where the field name is separated from options by a comma, what omitempty means, how the special case json : "-" works, how to combine multiple conventions in a single tag ( json + db), and which mistakes most often occur when working with tags.
    Open
  • Model invariants

    Go SELF
    21 level,4 lecture
    We break down why “just a struct” still doesn’t mean a correct model: we introduce the concept of invariants and learn to protect data at the boundary (stdin → parse → normalize → validate). Using a mini‑model Task as an example, we build rules ( ID > 0, non-empty Title after TrimSpace, valid Status), implement the ValidateTask and NewTask patterns, and discuss common mistakes when working with the zero value and validation.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
  • Game projects
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