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
  • Why os.Args “breaks” — motivation for flag

    Go SELF
    48 level,0 lecture
    We’ll break down what actually arrives to a Go program as CLI arguments (a slice [] string), why manual parsing via os.Args quickly turns into a mini-language that’s painful to maintain (validation, errors, --, short forms, help), and where this leads: it’s logical to move to the standard package flag, which takes care of the “boring” part of parsing arguments and generating usage.
    Open
  • flag — String/Int/Bool, Parse, Args

    Go SELF
    48 level,1 lecture
    We will go through the flag package in Go: how to declare flags via flag.String/ flag.Int/ flag.Bool, why the flag.Parse() call is needed, why the API returns pointers ( * T), and how to get positional arguments after parsing via flag.Args(), flag.NArg(), flag.Arg(i). We will also discuss the -- terminator and common mistakes when writing a CLI.
    Open
  • CLI design — commands, flags, positional arguments

    Go SELF
    48 level,2 lecture
    We break down a basic (but working) CLI contract in Go: where the command “verb” is ( add/ list/ done), what to do with positional arguments (via flag.Args(), flag.NArg(), flag.Arg(i)), and what to do with flags ( -priority, -limit). Plus: why the standard flag.Parse() “doesn’t like” flags after the command, how to build a dispatcher with switch, how to validate input (including err != nil), and why you should remember the terminator --.
    Open
  • stdout vs stderr and clean usage

    Go SELF
    48 level,3 lecture
    We go over the basic discipline of Go CLI programs: why “data” should be printed to stdout, while diagnostics and hints should go to stderr; how this relates to pipelines ( tool | other-tool) and redirection ( > file); and how to make a clean usage via flag.Usage + flag.PrintDefaults(), printing the help text to os.Stderr and the result to os.Stdout.
    Open
  • CLI architecture: parse → app layer → render output

    Go SELF
    48 level,4 lecture
    We break down a “human-friendly” architecture for a Go CLI app: we separate argument parsing ( parseArgs()) and validation ( validateConfig()) from business logic ( App) and output rendering (rendering to io.Writer). The result is a thin and boring main, a single error style via error, and discipline: results go to stdout, diagnostics go to stderr.
    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