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
  • json.Encoder/json.Decoder: streaming JSON processing

    Go SELF
    46 level,0 lecture
    We break down streaming work with JSON in Go: how the json.Marshal/ json.Unmarshal approach differs from json.Encoder/ json.Decoder, how to write JSON directly to an io.Writer and read from an io.Reader, how “value-by-value” reading works up to io.EOF, and how to choose a data protocol: an array or a stream of objects.
    Open
  • DisallowUnknownFields and strict JSON parsing

    Go SELF
    46 level,1 lecture
    We break down how to make JSON parsing in Go “strict”: we enable Decoder.DisallowUnknownFields(), understand why this works only when decoding into a struct (and not into a map), and add a check that after the first Decode the stream really ends ( io.EOF). In the end, we get a reusable helper for “one JSON with no trailing data” and a neat error wrapper via fmt.Errorf with %w.
    Open
  • json.Number and json.RawMessage — parsing JSON

    Go SELF
    46 level,2 lecture
    We’ll break down two practical techniques for safe JSON parsing in Go: how to avoid the “silent” conversion of numbers into float64 during dynamic decoding via any/ map[string]any using Decoder.UseNumber() and json.Number, and how to build a two-step “envelope → payload” parse using json.RawMessage, command dispatch via switch, and proper error wrapping ( %w).
    Open
  • JSON format versioning — {version, data}

    Go SELF
    46 level,3 lecture
    We break down a practical JSON versioning pattern via an “envelope” { version , data }: how to read the version as the first step, how to lazily parse the payload via json.RawMessage, how to keep migrations in DTO structs (v1/v2) and convert them to the domain model. We’ll show strict envelope decoding with json.Decoder and DisallowUnknownFields(), as well as ReadTasks/ WriteTasks functions (read all versions, write only the current one).
    Open
  • JSON errors: how to produce useful messages

    Go SELF
    46 level,4 lecture
    We break down how, in Go, to turn “raw” JSON error output into user-friendly messages: add operation context via fmt.Errorf and "%w", preserve the root cause for errors.Is/ errors.As, recognize typed errors from encoding/json (for example, * json.SyntaxError and * json.UnmarshalTypeError), convert Offset into line/column, and define an application boundary (CLI) where a “friendly message” is separated from the “technical cause.”
    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