How harshit3011/golang-exercises works
Purpose and topology
This is a collection of small, independent Go learning exercises and command-line programs rather than one deployable application. There is no repository-wide entry point or shared root module visible; most programs are launched separately from their own main.go or exercise source file.
Executable entry points
Standalone command programs are distributed across directories such as currency-convertor/main.go, project-empty-file-finder/main.go, word-finder/main.go, random-num-guess/main.go, and sorter/main.go. Additional exercises use files named for the exercise rather than main.go, including ex1/ex1.go through ex13/ex13.go.
Go module boundaries
Several directories declare independent Go modules: Channels/go.mod, Packages/go.mod, Testing/go.mod, and practice2/go.mod. These boundaries indicate examples can be built/tested in isolation and may have distinct dependency resolution. practice2/go.sum is the only visible dependency lock/checksum file.
Language-feature demonstration programs
The repository groups examples by Go concepts:
• Package/import behavior: Packages/main.go with Packages/helpers/helpers.go
• Goroutine/channel usage: Channels/main.go with Channels/helpers/helpers.go
• JSON processing: JSON/main.go
• OS and path APIs: Os_package/main.go, Path_package/main.go
• Interfaces and structs: Interfaces/file.go, struct-basic/main.go
These are self-contained demonstration boundaries, not services consumed by a common application.
File and text-processing flow
Several CLI programs appear centered on local input processing. project-empty-file-finder/main.go operates against a fixture directory at project-empty-file-finder/files, containing both empty and non-empty text files. word-finder/main.go and Os_package/main.go are likely additional filesystem/text-oriented examples; the latter has a bundled input file at Os_package/novel.txt. Their primary external boundary is the local filesystem.
Interactive and calculation exercises
Programs such as math-table/main.go, month-in-a-year/main.go, richter-scale/main.go, movie-ratings/main.go, housesMap/main.go, and hipsters-love-search/main.go represent separate input-to-output exercises. currency-convertor/main.go is similarly a standalone conversion program; no external exchange-rate service or infrastructure configuration is visible in the tree.
Testing
The dedicated testing example is isolated under Testing, with program code in Testing/main.go and tests in Testing/main_test.go. It should be run within that module boundary, independent of the other command examples.
Runtime and infrastructure
The material runtime is Go. No server framework, database, containerization, CI configuration, cloud infrastructure, or external service client is visible. Execution is local-process oriented: run individual directories/files, provide console or local-file inputs, and observe console/file-related output.
Main entry points: Packages/main.go Packages demo · Channels/main.go Channels demo · Testing/main.go Testing program · project-empty-file-finder/main.go Empty-file finder
Components 20
Standalone CLI exercises
Independent local Go programs.
- Interactive CLI exercises · Separate input-to-output calculation and guessing exercises.
- Currency converter
currency-convertor/main.go - Sorter
sorter/main.go - ex1–ex13 exercises · Exercise files are launched independently.
ex1/ex1.go
Language-feature demos
Self-contained Go concept examples.
- Packages demo
Packages/main.go - Package helpers
Packages/helpers/helpers.go - Channels demo
Channels/main.go - Channel helpers
Channels/helpers/helpers.go - JSON demo
JSON/main.go - Interfaces demo
Interfaces/file.go
Independent modules
Separate Go module boundaries.
- Testing module · Dedicated executable and test example.
Testing/go.mod - Testing program
Testing/main.go - Other Go modules · Channels, Packages, and practice2 resolve dependencies independently.
practice2/go.mod
Local file processing
Programs operating on local files and paths.
- Empty-file finder
project-empty-file-finder/main.go - File fixtures · Contains empty and non-empty text files.
project-empty-file-finder/files - Word finder
word-finder/main.go - OS package demo
Os_package/main.go - Novel input
Os_package/novel.txt - Path package demo
Path_package/main.go
Other components
- Local Go runtime · Programs are run independently as local processes.
Connections 20
- Interactive CLI exercises → Local Go runtime: run separately
- Currency converter → Local Go runtime: run
- Sorter → Local Go runtime: run
- ex1–ex13 exercises → Local Go runtime: run separately
- Packages demo → Package helpers: imports
- Packages demo → Local Go runtime: run
- Channels demo → Channel helpers: imports
- Channels demo → Local Go runtime: run
- JSON demo → Local Go runtime: run
- Interfaces demo → Local Go runtime: run
- Testing program → Testing module: built/tested in
- Testing program → Local Go runtime: run or test
- Channels demo → Other Go modules: module boundary
- Packages demo → Other Go modules: module boundary
- Empty-file finder → File fixtures: scans
- Empty-file finder → Local Go runtime: run
- Word finder → Local Go runtime: run
- OS package demo → Novel input: reads
- OS package demo → Local Go runtime: run
- Path package demo → Local Go runtime: run