# harshit3011/golang-exercises architecture

> Architecture diagram of the GitHub repository harshit3011/golang-exercises, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harshit3011/golang-exercises
- Repository: https://github.com/harshit3011/golang-exercises

## Overview

#### 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`](https://github.com/harshit3011/golang-exercises/blob/main/Packages/main.go) (Packages demo), [`Channels/main.go`](https://github.com/harshit3011/golang-exercises/blob/main/Channels/main.go) (Channels demo), [`Testing/main.go`](https://github.com/harshit3011/golang-exercises/blob/main/Testing/main.go) (Testing program), [`project-empty-file-finder/main.go`](https://github.com/harshit3011/golang-exercises/blob/main/project-empty-file-finder/main.go) (Empty-file finder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_standalone["Standalone CLI exercises"]
  node_cli_exercises["Interactive CLI exercises<br/>Go commands"]
  node_currency["Currency converter<br/>Go command<br/>[main.go]"]
  node_sorter["Sorter<br/>Go command<br/>[main.go]"]
  node_exercises["ex1–ex13 exercises<br/>Go exercise sources<br/>[ex1.go]"]
end

subgraph group_features["Language-feature demos"]
  node_packages_demo["Packages demo<br/>Go command<br/>[main.go]"]
  node_package_helpers["Package helpers<br/>Go package<br/>[helpers.go]"]
  node_channels_demo["Channels demo<br/>Go command<br/>[main.go]"]
  node_channel_helpers["Channel helpers<br/>Go package<br/>[helpers.go]"]
  node_json_demo["JSON demo<br/>Go command<br/>[main.go]"]
  node_interfaces_demo["Interfaces demo<br/>Go source<br/>[file.go]"]
end

subgraph group_modules["Independent modules"]
  node_testing_module{{"Testing module<br/>Go module<br/>[go.mod]"}}
  node_testing_program["Testing program<br/>Go command<br/>[main.go]"]
  node_other_modules{{"Other Go modules<br/>[go.mod]"}}
end

subgraph group_fileflow["Local file processing"]
  node_empty_finder["Empty-file finder<br/>Go command<br/>[main.go]"]
  node_fixture_files[("File fixtures<br/>local directory")]
  node_word_finder["Word finder<br/>Go command<br/>[main.go]"]
  node_os_demo["OS package demo<br/>Go command<br/>[main.go]"]
  node_novel_input["Novel input<br/>local text file<br/>[novel.txt]"]
  node_path_demo["Path package demo<br/>Go command<br/>[main.go]"]
end

node_go_runtime{{"Local Go runtime"}}

node_cli_exercises -->|"run separately"| node_go_runtime
node_currency -->|"run"| node_go_runtime
node_sorter -->|"run"| node_go_runtime
node_exercises -->|"run separately"| node_go_runtime
node_packages_demo -->|"imports"| node_package_helpers
node_packages_demo -->|"run"| node_go_runtime
node_channels_demo -->|"imports"| node_channel_helpers
node_channels_demo -->|"run"| node_go_runtime
node_json_demo -->|"run"| node_go_runtime
node_interfaces_demo -->|"run"| node_go_runtime
node_testing_program -->|"built/tested in"| node_testing_module
node_testing_program -->|"run or test"| node_go_runtime
node_channels_demo -.->|"module boundary"| node_other_modules
node_packages_demo -.->|"module boundary"| node_other_modules
node_empty_finder -->|"scans"| node_fixture_files
node_empty_finder -->|"run"| node_go_runtime
node_word_finder -->|"run"| node_go_runtime
node_os_demo -->|"reads"| node_novel_input
node_os_demo -->|"run"| node_go_runtime
node_path_demo -->|"run"| node_go_runtime

click node_currency "https://github.com/harshit3011/golang-exercises/blob/main/currency-convertor/main.go"
click node_sorter "https://github.com/harshit3011/golang-exercises/blob/main/sorter/main.go"
click node_exercises "https://github.com/harshit3011/golang-exercises/blob/main/ex1/ex1.go"
click node_packages_demo "https://github.com/harshit3011/golang-exercises/blob/main/Packages/main.go"
click node_package_helpers "https://github.com/harshit3011/golang-exercises/blob/main/Packages/helpers/helpers.go"
click node_channels_demo "https://github.com/harshit3011/golang-exercises/blob/main/Channels/main.go"
click node_channel_helpers "https://github.com/harshit3011/golang-exercises/blob/main/Channels/helpers/helpers.go"
click node_json_demo "https://github.com/harshit3011/golang-exercises/blob/main/JSON/main.go"
click node_interfaces_demo "https://github.com/harshit3011/golang-exercises/blob/main/Interfaces/file.go"
click node_testing_module "https://github.com/harshit3011/golang-exercises/blob/main/Testing/go.mod"
click node_testing_program "https://github.com/harshit3011/golang-exercises/blob/main/Testing/main.go"
click node_other_modules "https://github.com/harshit3011/golang-exercises/blob/main/practice2/go.mod"
click node_empty_finder "https://github.com/harshit3011/golang-exercises/blob/main/project-empty-file-finder/main.go"
click node_fixture_files "https://github.com/harshit3011/golang-exercises/tree/main/project-empty-file-finder/files"
click node_word_finder "https://github.com/harshit3011/golang-exercises/blob/main/word-finder/main.go"
click node_os_demo "https://github.com/harshit3011/golang-exercises/blob/main/Os_package/main.go"
click node_novel_input "https://github.com/harshit3011/golang-exercises/blob/main/Os_package/novel.txt"
click node_path_demo "https://github.com/harshit3011/golang-exercises/blob/main/Path_package/main.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli_exercises,node_currency,node_sorter,node_exercises toneBlue
class node_packages_demo,node_package_helpers,node_channels_demo,node_channel_helpers,node_json_demo,node_interfaces_demo toneAmber
class node_testing_module,node_testing_program,node_other_modules toneMint
class node_empty_finder,node_fixture_files,node_word_finder,node_os_demo,node_novel_input,node_path_demo toneRose
class node_go_runtime toneNeutral
```

## Components

### Standalone CLI exercises

Independent local Go programs.

- **Interactive CLI exercises**: Go commands · Separate input-to-output calculation and guessing exercises.
- [Currency converter](https://github.com/harshit3011/golang-exercises/blob/main/currency-convertor/main.go): Go command · `currency-convertor/main.go`
- [Sorter](https://github.com/harshit3011/golang-exercises/blob/main/sorter/main.go): Go command · `sorter/main.go`
- [ex1–ex13 exercises](https://github.com/harshit3011/golang-exercises/blob/main/ex1/ex1.go): Go exercise sources · Exercise files are launched independently. · `ex1/ex1.go`

### Language-feature demos

Self-contained Go concept examples.

- [Packages demo](https://github.com/harshit3011/golang-exercises/blob/main/Packages/main.go): Go command · `Packages/main.go`
- [Package helpers](https://github.com/harshit3011/golang-exercises/blob/main/Packages/helpers/helpers.go): Go package · `Packages/helpers/helpers.go`
- [Channels demo](https://github.com/harshit3011/golang-exercises/blob/main/Channels/main.go): Go command · `Channels/main.go`
- [Channel helpers](https://github.com/harshit3011/golang-exercises/blob/main/Channels/helpers/helpers.go): Go package · `Channels/helpers/helpers.go`
- [JSON demo](https://github.com/harshit3011/golang-exercises/blob/main/JSON/main.go): Go command · `JSON/main.go`
- [Interfaces demo](https://github.com/harshit3011/golang-exercises/blob/main/Interfaces/file.go): Go source · `Interfaces/file.go`

### Independent modules

Separate Go module boundaries.

- [Testing module](https://github.com/harshit3011/golang-exercises/blob/main/Testing/go.mod): Go module · Dedicated executable and test example. · `Testing/go.mod`
- [Testing program](https://github.com/harshit3011/golang-exercises/blob/main/Testing/main.go): Go command · `Testing/main.go`
- [Other Go modules](https://github.com/harshit3011/golang-exercises/blob/main/practice2/go.mod): 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](https://github.com/harshit3011/golang-exercises/blob/main/project-empty-file-finder/main.go): Go command · `project-empty-file-finder/main.go`
- [File fixtures](https://github.com/harshit3011/golang-exercises/tree/main/project-empty-file-finder/files): local directory · Contains empty and non-empty text files. · `project-empty-file-finder/files`
- [Word finder](https://github.com/harshit3011/golang-exercises/blob/main/word-finder/main.go): Go command · `word-finder/main.go`
- [OS package demo](https://github.com/harshit3011/golang-exercises/blob/main/Os_package/main.go): Go command · `Os_package/main.go`
- [Novel input](https://github.com/harshit3011/golang-exercises/blob/main/Os_package/novel.txt): local text file · `Os_package/novel.txt`
- [Path package demo](https://github.com/harshit3011/golang-exercises/blob/main/Path_package/main.go): Go command · `Path_package/main.go`

### Other components

- **Local Go runtime**: runtime · Programs are run independently as local processes.

## Connections

- 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
