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
  • //go:embed — embedding files and directories

    Go SELF
    44 level,0 lecture
    We break down how the compiler directive //go:embed lets you “bake” files and entire folders into a Go binary at the go build stage. We discuss the key rule about package-level variables, choose the receiver type ( string, []byte, embed.FS), connect the import correctly ( import _ "embed" vs import "embed"), work carefully with paths, and build a mini example for the tasker help command without reading from disk.
    Open
  • embed.FS — reading embedded resources

    Go SELF
    44 level,1 lecture
    We break down how to read embedded files from a binary via embed.FS and the shared interface fs.FS: why you should use functions from the io/fs package, how to diagnose “file not found” via fs.ReadDir, and why you should not blindly apply filepath.Join to paths inside embed.FS.
    Open
  • embed + io/fs: fs.Sub and unified access to resources

    Go SELF
    44 level,2 lecture
    We break down how to organize embedded resources in Go using embed and the io/fs abstractions: why you need fs.Sub, how to “re-root” a file tree and expose only fs.FS, how to centralize resource access in an assets package, and why for paths inside fs.FS you must not blindly use filepath.Join (you need path.Join). At the end: wiring it into a CLI and common mistakes.
    Open
  • Real-world embed cases: help texts, sample CSV/JSON, and templates

    Go SELF
    44 level,3 lecture
    We break down practical scenarios for embed in Go: how to embed a help text into the binary and read it via fs.ReadFile, how to keep sample CSV/JSON as a “format example” and print it via a CLI command, and how to parse templates via template.ParseFS without string concatenation. Plus: a neat assets package with a single resource root ( fs.Sub) and a walkthrough of common mistakes.
    Open
  • Gotchas of embed: paths, structure, size, build

    Go SELF
    44 level,4 lecture
    We break down practical “rakes” (common pitfalls) of embedded resources in Go: how a path inside fs.FS differs from an OS path, why you must not build paths for embed.FS using filepath.Join, how to choose //go:embed patterns, how to inspect contents with fs.ReadDir, why you may want to “re-root” resources via fs.Sub, and what you pay for convenience: bigger binaries, full-file reads via fs.ReadFile, mandatory rebuilds, and no “secrecy” for embedded files.
    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