Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: McGrath, Mike

Rating 3.5 AI initial rating

GO Programming in easy steps, 2nd edition is updated to cover the latest version of golang, and first illustrates the golang programming basics with variables, operators, flow control, and functions, before moving on to demonstrate Object-Oriented Programming (OOP) with golang. This book then shows how golang can handle user input, plus read and write files on your own system. The examples in GO Programming in easy steps, 2nd edition also demonstrate concurrent programming with goroutines for speed. Finally, the book illustrates how to create and interact with a golang web server on your own system. GO Programming in easy steps, 2nd edition has an easy-to-follow style that will appeal to: Anyone who wants begin programming in golang. Programmers looking to extend their skillset. Students who are studying programming at school or college. Those seeking a career in software development. This book makes no assumption that you have previous knowledge of any programming language, so is suitable for a beginner or a programming guru.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on, screenshot-driven introduction to Go that takes complete beginners from their first `go run` to a working local web server, while giving experienced programmers a fast, practical tour of Go's idioms. Best for self-learners, students, and career-changers who want to *do* rather than wade through theory. 【Book Arc】 - **Opening (~0%–12%)**: Sets up the toolchain and mental model — installing Go, creating a module with `go mod init`, understanding packages, the `main` entry point, canonical formatting (`go fmt`, tabs), and export rules. Solves the "how do I even start a Go project" problem. - **Early (~13%–32%)**: Core language fundamentals — variables (explicit `var` vs. implicit `:=`), constants and `iota`, static typing, `fmt.Printf` format specifiers, type conversions via `strconv`, comparison/bitwise operators, and operator precedence. Builds the vocabulary every later chapter assumes. - **Middle (~33%–55%)**: Flow control and functions — `if/else`, the three `for` forms (including Go's `while`-style loop and infinite loops with `break`), nested loops, the cautionary tale of `goto`, then function definition, pass-by-value semantics, return values, and variadic functions. - **Late (~56%–80%)**: Moves toward applied Go — object-oriented patterns (structs/methods as the excerpts imply), handling user input, and reading/writing files on the local system. This is where programs start touching the outside world. - **Ending (~80%–100%)**: Concurrency with goroutines and channels for speed, culminating in building and interacting with a local Go web server. Ties the fundamentals together into a small but complete real-world application. 【Key Takeaways】 - **Go rewards one canonical style** (Opening): The book stresses `go fmt`, tab indentation, short readable lines, and "clarity over cleverness" — adopting these habits early prevents fighting the language later. - **Packages and capitalization are the visibility system** (Opening): Capitalized identifiers are exported, lowercase are not; keep packages small and purpose-grouped rather than dumping everything into a `utils` package. - **Static typing is enforced, not optional** (Early): A variable only ever holds its declared type; `:=` infers it inside functions. Conversions like `strconv.Atoi`/`Itoa`/`ParseFloat` return a value *plus* an error — a pattern that recurs throughout Go. - **Formatting output is a skill worth drilling** (Early): `fmt.Printf` specifiers (width, alignment, precision, `%T` for type, `%%` for a literal percent) and manual `\n` handling are covered with runnable examples; floats round rather than truncate. - **Bitwise operators shine for compact flag fields** (Early): A single byte holds eight boolean flags — far cheaper than eight separate variables — even though many Go programmers rarely reach for them. - **Loops are deliberately minimal** (Middle): Go's single `for` keyword covers counting loops, `while`-style conditionals, and infinite loops with `break`; nesting beyond three levels is discouraged, and `goto` is presented as a last-resort escape from nested loops. - **Functions pass copies, not references** (Middle): Modifying a parameter inside a function leaves the caller's variable unchanged — a crucial mental model before tackling pointers and concurrency. - **Goroutines and channels are the concurrency story** (Late): The `go` keyword launches lightweight concurrent work; channels coordinate it and avoid shared-memory bugs; global variables in concurrent code are explicitly warned against. 【Reading Tips】 - **Type every example, don't just read it.** The book is built around step-by-step projects (`hello`, `vars`, `const`, `comp`, `order`, `goto`, etc.); the muscle memory of `mkdir` → `go mod init` → `go run .` is the real payoff. - **Skim the bitwise-operator section on a first pass** unless you're heading toward systems or embedded work — the book itself notes many Go programmers never use them. - **Deep-read the functions and concurrency chapters.** Pass-by-value semantics and channel-based coordination are where beginners form bad habits that are painful to unlearn. - **Treat `goto` as a cautionary chapter, not a tool to adopt.** Note the one legitimate use case (breaking out of nested loops) and move on. - **Keep the downloaded source archive open alongside the text** so you can diff your version against the reference when output doesn't match. 【Coverage Limits】 These excerpts cover the setup, fundamentals, flow control, functions, and early concurrency guidance in reasonable depth, but the OOP, file I/O, and web-server chapters are only summarized by the blurb — the excerpts do not cover their specific content, examples, or depth.
Page 4
e that this book contains accurate and current information. However, In Easy Steps Limited and the author shall not be liable for any loss or damage suffered...
View in text
Excerpt 2
t • Use modules (go.mod) for dependency management. Modern Go programming expects to see module-based projects. • Keep your project outside of the GOPATH dir...
View in text
Excerpt 3
how they may Go “bitwise” operators listed below: be used. Operator Name Example Operation & AND 0011 & 0101 = 0001 | OR 0011 | 0101 = 0111 ^ XOR 0011 ^ 0101...
View in text
Excerpt 4
ach loop iteration 58 Controlling Flow Creating a function Previous examples in this book have used the obligatory main( ) function and functions contained i...
View in text
Excerpt 5
project folder with a go.mod file mkdir audit cd audit audit go mod init example.com/audit l2 Next, create a “validate” subfolder mkdir validate validate l3...
View in text
Excerpt 6
person ) move( ) string { return "A person walks away." } l5 Add a function that receives the third interface as an argument and calls the implemented method...
View in text
Excerpt 7
nd negative values will retard the date. For example, time.AddDate( 1, 0, 0 ) will advance the date one year. Similarly, the time package’s Add( ) method can...
View in text
Excerpt 8
) l4 Now, count how many instances of a particular letter appear in the string fmt.Printf( "Count of 'e': %v \n", strings.Count( str, "e" ) ) l5 en, test whe...
View in text
Tags
AI categories
GoProgramming LanguageEducation
ISBN: 1787910520
Publisher: In Easy Steps
Publish Year: 2026
Language: English
Pages: 192
File Format: PDF
File Size: 4.5 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…