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
  • io.Reader and io.Writer: the foundation of I/O and testability

    Go SELF
    26 level,0 lecture
    We break down the streaming input/output model in Go and two key standard-library contracts — io.Reader and io.Writer: how to correctly interpret the n/ err pair, why io.EOF is the normal end of a stream, how not to get caught by a partial write, and why parameterizing functions via Reader/ Writer dramatically improves testability (you can substitute memory instead of files/network/console).
    Open
  • bytes.Buffer and strings.Builder

    Go SELF
    26 level,1 lecture
    We break down why it is useful to “collect output” via the io.Writer contract instead of printing from every function via fmt.Println. We compare bytes.Buffer (bytes + streaming reads via Read) and strings.Builder (fast string assembly), learn to redirect output into memory for checks and tests, and build a mini task renderer with WriteTasks.
    Open
  • Stream decorators — io.LimitReader, io.TeeReader, io.MultiWriter

    Go SELF
    26 level,2 lecture
    We break down “pipe attachments” in Go I/O: how to limit reads with io.LimitReader, how to “eavesdrop” on an input stream by copying into an io.Writer with io.TeeReader, and how to set up “double writes” to multiple targets with io.MultiWriter. We will assemble pipelines, discuss wrapper order, and cover common mistakes with n/ err and io.EOF.
    Open
  • io.Copy / io.CopyN

    Go SELF
    26 level,3 lecture
    We break down streaming copy in Go based on the io.Reader and io.Writer interfaces: how io.Copy works, why it returns the byte count as int64, what “partial progress” means ( written > 0 when err != nil), and how the strict contract of io.CopyN differs from “no more than N” via io.LimitReader. We will also discuss error enrichment via fmt.Errorf and wrapping with %w.
    Open
  • context.Context: Background, TODO, WithCancel

    Go SELF
    26 level,4 lecture
    We break down the basic mechanics of canceling operations in Go via context.Context: how context.Background() differs from context.TODO(), how to cancel work manually via context.WithCancel and the cancel() function, why it is important to call cancel even without an explicit cancellation, how to properly check ctx.Err() in long loops, and how to pass ctx as the first API parameter. At the end, there is a context tree diagram (Mermaid) and common mistakes.
    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