How marcombo/programacion-en-go works
Project Type and Purpose
• This isn’t a single production application, but rather a structured collection of independent code examples and tutorials.
• “ejemplos-libro” is organized by topics (e.g., “02-sintaxis-basica”, “03-control-de-flujo”, etc.) that illustrate different language features.
• “wasm-tutorial” offers working examples of WebAssembly programs (with web assets, a Go-based HTTP server, and WASM binaries).
Analysis of the File Structure
• At the top level, you have the README, a fe-de-erratas markdown file, and two main directories: “ejemplos-libro” and “wasm-tutorial”.
• Within “ejemplos-libro”, each numbered folder represents a dedicated set of examples covering topics from Go basics to more advanced subjects like concurrency, error handling, and testing.
• In “wasm-tutorial”, there are separate examples (e.g., “ejemplo-canvas” and “ejemplo”) that show how to set up a WebAssembly project using Go. Each of them has its own go.mod file, server code, web assets (HTML, WASM binaries, JS shim), and source code.
a. Main Components:
• Component 1: Educational Examples (ejemplos-libro)
• Treat each folder (like “02-sintaxis-basica”, “03-control-de-flujo”, etc.) as a module that illustrates key Go features.
• Sub-components are the individual Go files demonstrating specific code samples.
• Component 2: WebAssembly Tutorials (wasm-tutorial)
• Tutorial example (“ejemplo-canvas”, “ejemplo”) as a distinct module.
• Within each module, separate the server (backend) elements and the client/web assets (frontend) elements that are involved in serving and interacting with the WASM application.
• Other Elements:
• README, configuration files (like go.mod/go.sum), and supporting documentation (fe-de-erratas).
b. Relationships and Interactions:
• Branch the repository into two main segments: Educational Examples and WASM Tutorials.
c. Architectural Patterns/Design Principles:
• Modularity: Each chapter or tutorial is independent and self-explanatory.
• Separation of Concerns: Distinguish clearly between backend logic (Go server in the wasm examples) and the client presentation layers (HTML, WASM, JS).
• Use of Go Modules: Represent modules like go.mod files that ensure dependency management in separate sub-projects.
d. Technologies, Frameworks, or Libraries:
• Go (Golang): Central language used in all modules.
• WebAssembly components: When drawing the “wasm-tutorial” part, include client-side web technologies (HTML, wasm_exec.js) and highlight how Go compiles to WASM.
• Standard Libraries: For networking (HTTP server in the wasm tutorials) and file IO (illustrated in the examples on I/O).