Showing preview only (1,959K chars total). Download the full file or copy to clipboard to get everything.
Repository: inancgumus/learngo
Branch: master
Commit: 3c475a78e543
Files: 1533
Total size: 1.6 MB
Directory structure:
gitextract_uy2gop8w/
├── .gitignore
├── 01-get-started/
│ ├── README.md
│ ├── osx-installation.md
│ ├── programmers-roadmap.md
│ ├── ubuntu-installation.md
│ └── windows-installation.md
├── 02-write-your-first-program/
│ ├── README.md
│ ├── annotated-go-program-example.md
│ ├── exercises/
│ │ ├── 01-print-names/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ ├── main.go
│ └── questions/
│ ├── 01-gopath/
│ │ └── README.md
│ ├── 02-code-your-first-program/
│ │ └── README.md
│ └── 03-run-your-first-program/
│ └── README.md
├── 03-packages-and-scopes/
│ ├── 01-packages/
│ │ ├── bye.go
│ │ ├── hey.go
│ │ └── main.go
│ ├── 02-scopes/
│ │ ├── 01-scopes/
│ │ │ └── main.go
│ │ ├── 02-block-scope/
│ │ │ └── main.go
│ │ ├── 03-nested-scope/
│ │ │ └── main.go
│ │ └── 04-package-scope/
│ │ ├── bye.go
│ │ ├── hey.go
│ │ └── main.go
│ ├── 03-importing/
│ │ ├── 01-file-scope/
│ │ │ ├── bye.go
│ │ │ └── main.go
│ │ └── 02-renaming/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-packages/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── bye.go
│ │ │ ├── greet.go
│ │ │ └── main.go
│ │ ├── 02-scopes/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── main.go
│ │ │ └── printer.go
│ │ ├── 03-importing/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 01-packages-A/
│ │ └── README.md
│ ├── 02-packages-B/
│ │ └── README.md
│ └── 03-scopes/
│ └── README.md
├── 04-statements-expressions-comments/
│ ├── 01-statements/
│ │ ├── 01-execution-flow/
│ │ │ └── main.go
│ │ └── 02-semicolons/
│ │ └── main.go
│ ├── 02-expressions/
│ │ ├── 01-operator/
│ │ │ └── main.go
│ │ └── 02-call-expression/
│ │ └── main.go
│ ├── 03-comments/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-shy-semicolons/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-naked-expression/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-operators-combine/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-print-go-version/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-comment-out/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-use-godoc/
│ │ │ ├── exercise.md
│ │ │ └── solution/
│ │ │ └── solution.md
│ │ └── README.md
│ └── questions/
│ ├── 01-statements/
│ │ └── README.md
│ ├── 02-expressions/
│ │ └── README.md
│ └── 03-comments/
│ └── README.md
├── 05-write-your-first-library-package/
│ ├── exercise/
│ │ ├── README.md
│ │ └── solution/
│ │ └── golang/
│ │ ├── cmd/
│ │ │ └── main.go
│ │ └── go.go
│ ├── printer/
│ │ ├── cmd/
│ │ │ └── main.go
│ │ └── printer.go
│ └── questions/
│ └── README.md
├── 06-variables/
│ ├── 01-basic-data-types/
│ │ ├── exercises/
│ │ │ ├── 01-print-the-literals/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-print-hexes/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ ├── main.go
│ │ └── questions/
│ │ └── README.md
│ ├── 02-declarations/
│ │ ├── 01-declaration-syntax/
│ │ │ ├── 01-syntax/
│ │ │ │ └── main.go
│ │ │ ├── 02-naming-rules/
│ │ │ │ └── main.go
│ │ │ └── 03-order-of-declaration/
│ │ │ └── main.go
│ │ ├── 02-example-declarations/
│ │ │ ├── 01-int/
│ │ │ │ └── main.go
│ │ │ ├── 02-float64/
│ │ │ │ └── main.go
│ │ │ ├── 03-bool/
│ │ │ │ └── main.go
│ │ │ └── 04-string/
│ │ │ └── main.go
│ │ ├── 03-zero-values/
│ │ │ └── main.go
│ │ ├── 04-unused-variables-and-blank-identifier/
│ │ │ ├── 01-unused-variable/
│ │ │ │ └── main.go
│ │ │ └── 02-blank-identifier/
│ │ │ └── main.go
│ │ ├── 05-multiple-declarations/
│ │ │ ├── 01-multiple/
│ │ │ │ └── main.go
│ │ │ └── 02-parallel/
│ │ │ └── main.go
│ │ ├── 06-examples/
│ │ │ └── main.go
│ │ ├── exercises/
│ │ │ ├── 01-int/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-bool/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-float64/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-string/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-undeclarables/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 06-with-bits/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 07-multiple/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 08-multiple-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 09-unused/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 10-package-variable/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 11-wrong-doer/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── questions/
│ │ ├── 01-what/
│ │ │ └── README.md
│ │ ├── 02-declaration/
│ │ │ └── README.md
│ │ ├── 03-unused-variables/
│ │ │ └── README.md
│ │ └── 04-zero-values/
│ │ └── README.md
│ ├── 03-short-declaration/
│ │ ├── 01-initialization-and-short-declaration/
│ │ │ ├── 01-initialization/
│ │ │ │ └── main.go
│ │ │ ├── 02-short-declaration/
│ │ │ │ └── main.go
│ │ │ └── 03-coding-example/
│ │ │ └── main.go
│ │ ├── 02-package-scope/
│ │ │ └── main.go
│ │ ├── 03-multiple-short-declaration/
│ │ │ ├── 01-declaration/
│ │ │ │ └── main.go
│ │ │ ├── 02-coding-example/
│ │ │ │ └── main.go
│ │ │ └── 03-redeclaration/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02-coding-example/
│ │ │ └── main.go
│ │ ├── 04-short-vs-normal/
│ │ │ ├── 01-declaration/
│ │ │ │ └── main.go
│ │ │ └── 02-short-declaration/
│ │ │ └── main.go
│ │ ├── exercises/
│ │ │ ├── 01-short-declare/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-multiple-short-declare/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-multiple-short-declare-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-short-with-expression/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-short-discard/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 06-redeclare/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── questions/
│ │ └── README.md
│ ├── 04-assignment/
│ │ ├── 01-assignment/
│ │ │ ├── 01-assignment/
│ │ │ │ └── main.go
│ │ │ ├── 02-strongly-typed/
│ │ │ │ └── main.go
│ │ │ └── 03-examples/
│ │ │ └── main.go
│ │ ├── 01-overview/
│ │ │ └── main.go
│ │ ├── 05-multiple-assignment/
│ │ │ └── main.go
│ │ ├── 06-swapping/
│ │ │ └── main.go
│ │ ├── 07-path-project/
│ │ │ └── main.go
│ │ ├── 08-path-project-discarding/
│ │ │ └── main.go
│ │ ├── 09-path-project-shortdecl/
│ │ │ └── main.go
│ │ ├── exercises/
│ │ │ ├── 01-make-it-blue/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-vars-to-vars/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-assign-with-expressions/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-find-the-rectangle-perimeter/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-multi-assign/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 06-multi-assign-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 07-multi-short-func/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 08-swapper/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 09-swapper-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 10-discard-the-file/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── questions/
│ │ └── README.md
│ ├── 05-type-conversion/
│ │ ├── 01-destructive/
│ │ │ └── main.go
│ │ ├── 02-correct/
│ │ │ └── main.go
│ │ ├── 03-numeric-conversion/
│ │ │ └── main.go
│ │ ├── exercises/
│ │ │ ├── 01-convert-and-fix/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-convert-and-fix-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-convert-and-fix-3/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-convert-and-fix-4/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-convert-and-fix-5/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── questions/
│ │ └── questions.md
│ └── 06-project-greeter/
│ ├── 01-demonstration/
│ │ └── main.go
│ ├── 02-version1/
│ │ └── main.go
│ ├── 03-version2/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-count-arguments/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-print-the-path/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-print-your-name/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-greet-more-people/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-greet-5-people/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── README.md
│ │ └── solution-to-the-lecture-exercise/
│ │ └── main.go
│ └── questions/
│ └── questions.md
├── 07-printf/
│ ├── 01-intro/
│ │ ├── 01-println-vs-printf/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 02-escape-sequences/
│ │ └── main.go
│ ├── 03-printing-types/
│ │ └── main.go
│ ├── 04-coding/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-print-your-age/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-print-your-name-and-lastname/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-false-claims/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-print-the-temperature/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-double-quotes/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-print-the-type/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-print-the-type-2/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-print-the-type-3/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-print-the-type-4/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 10-print-your-fullname/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── questions.md
├── 08-numbers-and-strings/
│ ├── 01-numbers/
│ │ ├── 01-arithmetic-operators/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ └── 03-float-inaccuracy/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ └── 03/
│ │ │ └── main.go
│ │ ├── 02-arithmetic-operators-examples/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 03-precedence/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ ├── 03/
│ │ │ │ └── main.go
│ │ │ └── 04/
│ │ │ └── main.go
│ │ ├── 04-incdec-statement/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ └── 03/
│ │ │ └── main.go
│ │ ├── 05-assignment-operations/
│ │ │ └── main.go
│ │ ├── 06-project-feet-to-meters/
│ │ │ ├── exercise-solution/
│ │ │ │ └── main.go
│ │ │ └── main.go
│ │ ├── exercises/
│ │ │ ├── 01-do-some-calculations/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-fix-the-float/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-precedence/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-incdecs/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-manipulate-a-counter/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 06-simplify-the-assignments/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 07-circle-area/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 08-sphere-area/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 09-sphere-volume/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── questions/
│ │ ├── 01-arithmetic-operators.md
│ │ ├── 02-precedence.md
│ │ └── 03-assignment-operations.md
│ └── 02-strings/
│ ├── 01-raw-string-literal/
│ │ └── main.go
│ ├── 02-concatenation/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02-assignment-operation/
│ │ │ └── main.go
│ │ └── 03-concat-non-strings/
│ │ └── main.go
│ ├── 03-string-length/
│ │ ├── 01-len/
│ │ │ └── main.go
│ │ └── 02-unicode-len/
│ │ └── main.go
│ ├── 04-project-banger/
│ │ ├── exercise-solution/
│ │ │ └── main.go
│ │ └── main.go
│ ├── README.md
│ ├── exercises/
│ │ ├── 01-windows-path/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-print-json/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-raw-concat/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-count-the-chars/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-improved-banger/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-tolowercase/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-trim-it/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── 08-right-trim-it/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ └── questions/
│ └── questions.md
├── 09-go-type-system/
│ ├── 01-bits/
│ │ └── main.go
│ ├── 02-bytes/
│ │ └── main.go
│ ├── 03-predeclared-types/
│ │ └── main.go
│ ├── 04-overflow/
│ │ ├── 01-problem/
│ │ │ └── main.go
│ │ ├── 02-explain/
│ │ │ └── main.go
│ │ └── 03-destructive/
│ │ └── main.go
│ ├── 05-defined-types/
│ │ ├── 01-duration-example/
│ │ │ └── main.go
│ │ ├── 02-type-definition-create-your-own-type/
│ │ │ └── main.go
│ │ └── 03-underlying-types/
│ │ ├── main.go
│ │ └── weights/
│ │ └── weights.go
│ ├── 06-aliased-types/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-optimal-types/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-the-type-problem/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-parse-arg-numbers/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-time-multiplier/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-refactor-feet-to-meter/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-convert-the-types/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 01-questions-predeclared-types.md
│ └── 02-questions-defined-types.md
├── 10-constants/
│ ├── 01-declarations/
│ │ ├── 01-syntax/
│ │ │ ├── 01-magic-numbers/
│ │ │ │ └── main.go
│ │ │ ├── 02-constants/
│ │ │ │ └── main.go
│ │ │ ├── 03-safety/
│ │ │ │ └── main.go
│ │ │ └── 04-rules/
│ │ │ ├── 01-immutability/
│ │ │ │ └── main.go
│ │ │ ├── 02-runtime-func/
│ │ │ │ └── main.go
│ │ │ ├── 03-runtime-var/
│ │ │ │ └── main.go
│ │ │ └── 04-len/
│ │ │ └── main.go
│ │ ├── 02-constant-types-and-expressions/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ └── 03/
│ │ │ └── main.go
│ │ └── 03-multiple-declaration/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ └── 03/
│ │ └── main.go
│ ├── 02-typeless-constants/
│ │ ├── 01-typeless-constants/
│ │ │ └── main.go
│ │ ├── 02-typed-vs-typeless/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ ├── 03/
│ │ │ │ └── main.go
│ │ │ └── 04/
│ │ │ └── main.go
│ │ ├── 03-default-type/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ ├── 03/
│ │ │ │ └── main.go
│ │ │ ├── 04/
│ │ │ │ └── main.go
│ │ │ └── 05/
│ │ │ └── main.go
│ │ └── 04-demo/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 03-refactor-feet-to-meters/
│ │ ├── main.go
│ │ └── solution/
│ │ ├── main.go
│ │ └── without-comments/
│ │ └── main.go
│ ├── 04-iota/
│ │ ├── 01-manually/
│ │ │ └── main.go
│ │ ├── 02-with-iota/
│ │ │ └── main.go
│ │ ├── 03-expressions/
│ │ │ └── main.go
│ │ └── 04-blank-identifier/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ └── 03/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-minutes-in-weeks/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-remove-the-magic/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-constant-length/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-tau/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-area/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-no-conversions-allowed/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-iota-months/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-iota-months-2/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-iota-seasons/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── questions.md
├── 11-if/
│ ├── 01-boolean-operators/
│ │ ├── 01-comparison-operators/
│ │ │ └── main.go
│ │ ├── 02-comparison-and-assignability/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ └── 03/
│ │ │ └── main.go
│ │ └── 03-logical-operators/
│ │ ├── 01-and-operator/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 02-or-operator/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ └── 03-not-operator/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 02-if-statement/
│ │ ├── 01-if-branch/
│ │ │ └── main.go
│ │ ├── 02-else-branch/
│ │ │ └── main.go
│ │ ├── 03-else-if-branch/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 04-refactor-feet-to-meters/
│ │ │ └── main.go
│ │ └── 05-challenge-userpass/
│ │ ├── 01-1st-challenge/
│ │ │ ├── 01-challenge/
│ │ │ │ └── main.go
│ │ │ ├── 02-solution/
│ │ │ │ └── main.go
│ │ │ └── 03-solution-refactor/
│ │ │ └── main.go
│ │ └── 02-2nd-challenge/
│ │ ├── 01-challenge/
│ │ │ └── main.go
│ │ └── 02-solution/
│ │ └── main.go
│ ├── 03-error-handling/
│ │ ├── 01-itoa/
│ │ │ └── main.go
│ │ ├── 02-atoi/
│ │ │ └── main.go
│ │ ├── 03-atoi-error-handling/
│ │ │ └── main.go
│ │ └── 04-challenge-feet-to-meters/
│ │ ├── 01-challenge/
│ │ │ └── main.go
│ │ └── 02-solution/
│ │ └── main.go
│ ├── 04-short-if/
│ │ ├── 01-without-short-if/
│ │ │ └── main.go
│ │ ├── 02-with-short-if/
│ │ │ └── main.go
│ │ ├── 03-scope/
│ │ │ └── main.go
│ │ └── 04-scope-shadowing/
│ │ ├── 01-shadowing/
│ │ │ └── main.go
│ │ └── 02-shadowing-solution/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-age-seasons/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-simplify-it/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-arg-count/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-vowel-or-cons/
│ │ │ ├── main.go
│ │ │ ├── solution/
│ │ │ │ └── main.go
│ │ │ └── solution2/
│ │ │ └── main.go
│ │ ├── 05-movie-ratings/
│ │ │ ├── main.go
│ │ │ ├── solution/
│ │ │ │ └── main.go
│ │ │ └── solution2/
│ │ │ └── main.go
│ │ ├── 06-odd-even/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-leap-year/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-simplify-leap-year/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-days-in-month/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 1-comparison-operators.md
│ ├── 2-logical-operators.md
│ ├── 3-if.md
│ ├── 4-error-handling.md
│ └── 5-short-if.md
├── 12-switch/
│ ├── 01-one-case/
│ │ └── main.go
│ ├── 02-multiple-cases/
│ │ └── main.go
│ ├── 03-default-clause/
│ │ └── main.go
│ ├── 04-multiple-conditions/
│ │ └── main.go
│ ├── 05-bool-expressions/
│ │ └── main.go
│ ├── 06-fallthrough/
│ │ ├── 01-without/
│ │ │ └── main.go
│ │ └── 02-with/
│ │ └── main.go
│ ├── 07-short-switch/
│ │ └── main.go
│ ├── 08-parts-of-the-day/
│ │ └── main.go
│ ├── 09-when-to-use/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-richter-scale/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-richter-scale-2/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-convert/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-string-manipulator/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-days-in-month/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── questions.md
├── 13-loops/
│ ├── 01-basics/
│ │ └── main.go
│ ├── 02-break/
│ │ └── main.go
│ ├── 03-continue/
│ │ ├── 01-a-before/
│ │ │ └── main.go
│ │ └── 01-b-after/
│ │ └── main.go
│ ├── 04-nested-loops-multiplication-table/
│ │ └── main.go
│ ├── 05-for-range/
│ │ ├── 01-loop-over-slices/
│ │ │ └── main.go
│ │ └── 02-loop-over-words/
│ │ └── main.go
│ ├── 06-project-lucky-number-game/
│ │ ├── 01-randomization/
│ │ │ └── main.go
│ │ └── 02-game/
│ │ └── main.go
│ ├── 07-project-word-finder/
│ │ └── main.go
│ ├── 08-word-finder-labeled-break/
│ │ └── main.go
│ ├── 09-word-finder-labeled-continue/
│ │ └── main.go
│ ├── 10-word-finder-labeled-switch/
│ │ └── main.go
│ ├── 11-goto/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-basics.md
│ │ ├── 01-sum-the-numbers/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-multiplication-table.md
│ │ ├── 02-sum-the-numbers-verbose/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-lucky-number.md
│ │ ├── 03-sum-up-to-n/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-only-evens/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-word-finder.md
│ │ ├── 05-break-up/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-crunch-the-primes.md
│ │ ├── 06-infinite-kill/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-multiplication-table-exercises/
│ │ │ ├── 01-dynamic-table/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── 02-math-tables/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-lucky-number-exercises/
│ │ │ ├── 01-first-turn-winner/
│ │ │ │ ├── main.go
│ │ │ │ ├── solution/
│ │ │ │ │ └── main.go
│ │ │ │ └── solution-better/
│ │ │ │ └── main.go
│ │ │ ├── 02-random-messages/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-double-guesses/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-verbose-mode/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-enough-picks/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── 06-dynamic-difficulty/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-word-finder-exercises/
│ │ │ ├── 01-case-insensitive/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── 02-path-searcher/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 10-crunch-the-primes/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 01-loops.md
│ ├── 02-randomization.md
│ └── 03-labeled-statements.md
├── 14-arrays/
│ ├── 01-whats-an-array/
│ │ └── main.go
│ ├── 02-examples-1-hipsters-love-bookstore/
│ │ └── main.go
│ ├── 03-examples-2-hipsters-love-bookstore/
│ │ └── main.go
│ ├── 04-array-literal/
│ │ └── main.go
│ ├── 05-examples-3-hipsters-love-bookstore/
│ │ └── main.go
│ ├── 06-challenge-moodly/
│ │ ├── challenge/
│ │ │ └── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 07-compare/
│ │ └── main.go
│ ├── 08-assignment/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02-example/
│ │ └── main.go
│ ├── 09-multi-dimensional/
│ │ └── main.go
│ ├── 10-challenge-moodly-2/
│ │ ├── challenge/
│ │ │ └── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 11-keyed-elements/
│ │ ├── 01-unkeyed/
│ │ │ └── main.go
│ │ ├── 02-keyed/
│ │ │ └── main.go
│ │ ├── 03-keyed-order/
│ │ │ └── main.go
│ │ ├── 04-keyed-auto-initialize/
│ │ │ └── main.go
│ │ ├── 05-keyed-auto-initialize-ellipsis/
│ │ │ └── main.go
│ │ ├── 06-keyed-and-unkeyed/
│ │ │ └── main.go
│ │ └── 07-xratio-example/
│ │ ├── 01-without-keys/
│ │ │ └── main.go
│ │ └── 02-with-keys/
│ │ └── main.go
│ ├── 12-compare-unnamed/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-declare-empty/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-get-set-arrays/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-array-literal/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-ellipsis/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-fix/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-compare/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-assign/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-wizard-printer/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-currency-converter/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 10-hipsters-love-search/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 11-average/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 12-sorter/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 13-word-finder/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 1-array-basics.md
│ ├── 2-arrays.md
│ └── README.md
├── 15-project-retro-led-clock/
│ ├── 01-printing-the-digits/
│ │ ├── README.md
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 02-printing-the-clock/
│ │ ├── README.md
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 03-animating-the-clock/
│ │ ├── README.md
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 04-blinking-the-separators/
│ │ ├── README.md
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 05-full-annotated-solution/
│ │ └── main.go
│ ├── README.md
│ └── exercises/
│ ├── 01-refactor/
│ │ ├── main.go
│ │ └── solution/
│ │ ├── main.go
│ │ └── placeholders.go
│ ├── 02-alarm/
│ │ ├── main.go
│ │ ├── placeholders.go
│ │ └── solution/
│ │ ├── main.go
│ │ └── placeholders.go
│ ├── 03-split-second/
│ │ ├── main.go
│ │ ├── placeholders.go
│ │ └── solution/
│ │ ├── main.go
│ │ └── placeholders.go
│ ├── 04-ticker/
│ │ ├── main.go
│ │ ├── placeholders.go
│ │ └── solution/
│ │ ├── main.go
│ │ └── placeholders.go
│ └── README.md
├── 16-slices/
│ ├── 01-slices-vs-arrays/
│ │ └── main.go
│ ├── 02-slices-vs-arrays/
│ │ └── main.go
│ ├── 03-slices-vs-arrays-examples/
│ │ └── main.go
│ ├── 04-slices-vs-arrays-unique-nums/
│ │ ├── 01-with-arrays/
│ │ │ └── main.go
│ │ └── 02-with-slices/
│ │ └── main.go
│ ├── 05-append/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 06-slice-expressions/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 07-slice-expressions-pagination/
│ │ └── main.go
│ ├── 08-slice-internals-1-backing-array/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 09-slice-internals-2-slice-header/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 10-slice-internals-3-len-cap/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 11-slice-internals-4-append/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ ├── 2-example/
│ │ │ └── main.go
│ │ ├── 3-example-growth/
│ │ │ └── main.go
│ │ └── 4-example-growth/
│ │ └── main.go
│ ├── 12-full-slice-expressions/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 13-make/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 14-copy/
│ │ ├── 01-usage/
│ │ │ └── main.go
│ │ └── 02-hacker-incident/
│ │ └── main.go
│ ├── 15-multi-dimensional-slices/
│ │ ├── version-1/
│ │ │ └── main.go
│ │ ├── version-2/
│ │ │ └── main.go
│ │ └── version-3/
│ │ └── main.go
│ ├── README.md
│ ├── exercises/
│ │ ├── 01-declare-nil/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-empty/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-slice-literal/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-declare-arrays-as-slices/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-fix-the-problems/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-compare-the-slices/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-append/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-append-2/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-append-3-fix/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 10-append-sort-nums/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 11-housing-prices/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 12-housing-prices-averages/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 13-slicing-basics/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 14-slicing-by-args/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 15-slicing-housing-prices/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 16-internals-backing-array-fix/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 17-internals-backing-array-sort/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 18-internals-slice-header/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 19-observe-len-cap/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 20-observe-the-cap-growth/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 21-correct-the-lyric/
│ │ │ ├── hints.md
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 22-adv-ops-practice/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 23-limit-the-backing-array-sharing/
│ │ │ ├── api/
│ │ │ │ └── api.go
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── api/
│ │ │ │ └── api.go
│ │ │ └── main.go
│ │ ├── 24-fix-the-memory-leak/
│ │ │ ├── api/
│ │ │ │ └── api.go
│ │ │ ├── hints.md
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── api/
│ │ │ │ └── api.go
│ │ │ └── main.go
│ │ ├── 25-add-lines/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 26-print-daily-requests/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 1-slices-vs-arrays.md
│ ├── 2-appending.md
│ ├── 3-slicing.md
│ ├── 4-backing-array.md
│ ├── 5-slice-header.md
│ ├── 6-capacity.md
│ ├── 7-mechanics-of-append.md
│ ├── 8-advanced-ops.md
│ └── README.md
├── 17-project-empty-file-finder/
│ ├── 01-fetch-the-files/
│ │ ├── files/
│ │ │ ├── empty1.txt
│ │ │ ├── empty2.txt
│ │ │ ├── empty3.txt
│ │ │ ├── nonEmpty1.txt
│ │ │ ├── nonEmpty2.txt
│ │ │ └── nonEmpty3.txt
│ │ └── main.go
│ ├── 02-write-to-a-file/
│ │ ├── files/
│ │ │ ├── empty1.txt
│ │ │ ├── empty2.txt
│ │ │ ├── empty3.txt
│ │ │ ├── nonEmpty1.txt
│ │ │ ├── nonEmpty2.txt
│ │ │ └── nonEmpty3.txt
│ │ └── main.go
│ ├── 03-optimize/
│ │ ├── files/
│ │ │ ├── empty1.txt
│ │ │ ├── empty2.txt
│ │ │ ├── empty3.txt
│ │ │ ├── nonEmpty1.txt
│ │ │ ├── nonEmpty2.txt
│ │ │ └── nonEmpty3.txt
│ │ └── main.go
│ └── exercises/
│ ├── 1-sort-to-a-file/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 2-sort-to-a-file-2/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 3-print-directories/
│ │ ├── main.go
│ │ └── solution/
│ │ ├── dir/
│ │ │ ├── .gitignore
│ │ │ ├── subdir1/
│ │ │ │ └── .gitignore
│ │ │ └── subdir2/
│ │ │ └── .gitignore
│ │ ├── dir2/
│ │ │ ├── .gitignore
│ │ │ ├── subdir1/
│ │ │ │ └── .gitignore
│ │ │ ├── subdir2/
│ │ │ │ └── .gitignore
│ │ │ └── subdir3/
│ │ │ └── .gitignore
│ │ ├── dirs.txt
│ │ └── main.go
│ └── README.md
├── 18-project-bouncing-ball/
│ ├── 01-draw-the-board/
│ │ └── main.go
│ ├── 02-add-a-buffer/
│ │ └── main.go
│ ├── 03-animate/
│ │ └── main.go
│ ├── README.md
│ └── exercises/
│ ├── 01-find-the-bug/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 02-width-and-height/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 03-previous-positions/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 04-single-dimensional/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 05-no-slice/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ └── README.md
├── 19-strings-runes-bytes/
│ ├── 01-bytes-runes-strings-basics/
│ │ └── main.go
│ ├── 02-bytes-runes-strings-charset-table/
│ │ └── main.go
│ ├── 03-bytes-runes-strings-examples/
│ │ └── main.go
│ ├── 04-rune-decoding/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ ├── benchmarks/
│ │ │ └── main.go
│ │ └── main.go
│ ├── 05-internals/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-convert/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-print-the-runes/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-rune-manipulator/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── README.md
├── 20-project-spam-masker/
│ ├── 01-step-1/
│ │ ├── main.go
│ │ └── spam.txt
│ ├── 02-step-2/
│ │ ├── main.go
│ │ └── spam.txt
│ ├── 03-step-2-no-append/
│ │ ├── main.go
│ │ └── spam.txt
│ └── README.md
├── 21-project-text-wrapper/
│ ├── README.md
│ ├── main.go
│ └── story.txt
├── 22-maps/
│ ├── 01-english-dict/
│ │ ├── 01-as-a-slice/
│ │ │ └── main.go
│ │ └── 02-as-a-map/
│ │ └── main.go
│ ├── 02-english-dict-map-populate/
│ │ └── main.go
│ ├── 03-internals-cloning/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-warm-up/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-populate/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-students/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── README.md
├── 23-input-scanning/
│ ├── 01-scanning/
│ │ ├── main.go
│ │ └── proverbs.txt
│ ├── 02-map-as-sets/
│ │ ├── main.go
│ │ └── shakespeare.txt
│ ├── 03-project-log-parser/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-uppercaser/
│ │ │ ├── main.go
│ │ │ ├── shakespeare.txt
│ │ │ └── solution/
│ │ │ ├── main.go
│ │ │ └── shakespeare.txt
│ │ ├── 02-unique-words/
│ │ │ ├── main.go
│ │ │ ├── shakespeare.txt
│ │ │ └── solution/
│ │ │ ├── main.go
│ │ │ └── shakespeare.txt
│ │ ├── 03-unique-words-2/
│ │ │ ├── main.go
│ │ │ ├── shakespeare.txt
│ │ │ └── solution/
│ │ │ ├── main.go
│ │ │ └── shakespeare.txt
│ │ ├── 04-grep/
│ │ │ ├── main.go
│ │ │ ├── shakespeare.txt
│ │ │ └── solution/
│ │ │ ├── main.go
│ │ │ └── shakespeare.txt
│ │ ├── 05-quit/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-log-parser/
│ │ │ ├── log.txt
│ │ │ ├── log_err_missing.txt
│ │ │ ├── log_err_negative.txt
│ │ │ ├── log_err_str.txt
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── README.md
├── 24-structs/
│ ├── 01-intro/
│ │ └── main.go
│ ├── 02-basics/
│ │ └── main.go
│ ├── 03-compare-assign/
│ │ └── main.go
│ ├── 04-embedding/
│ │ └── main.go
│ ├── 05-project-log-parser-structs/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ └── main.go
│ ├── 06-encoding/
│ │ └── main.go
│ ├── 07-decoding/
│ │ ├── main.go
│ │ └── users.json
│ ├── 08-decoding-2/
│ │ ├── main.go
│ │ └── users.json
│ ├── exercises/
│ │ ├── 01-warmup/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-list/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-query-by-id/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-encode/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-decode/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── README.md
├── 25-functions/
│ ├── 01-basics/
│ │ ├── bad.go
│ │ └── main.go
│ ├── 02-basics/
│ │ └── main.go
│ ├── 03-refactor-to-funcs/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── 04-pass-by-value-semantics/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── exercises/
│ │ ├── README.md
│ │ ├── refactor-to-funcs-1/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── games.go
│ │ │ └── main.go
│ │ ├── refactor-to-funcs-2/
│ │ │ ├── games.go
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── commands.go
│ │ │ ├── games.go
│ │ │ └── main.go
│ │ ├── refactor-to-funcs-3/
│ │ │ ├── commands.go
│ │ │ ├── games.go
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── commands.go
│ │ │ ├── games.go
│ │ │ └── main.go
│ │ └── rewrite-log-parser-using-funcs/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ └── main.go
│ └── questions/
│ └── README.md
├── 26-pointers/
│ ├── 01-pointers/
│ │ └── main.go
│ ├── 02-pointers-basic-examples/
│ │ └── main.go
│ ├── 03-pointers-composites/
│ │ └── main.go
│ ├── 04-log-parser-pointers/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── 05-log-parser-pointers-vs-values/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── exercises/
│ │ ├── 01-basics/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-swap/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-fix-the-crash/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-simplify/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-log-parser/
│ │ │ ├── log.txt
│ │ │ ├── log_err_missing.txt
│ │ │ ├── log_err_negative.txt
│ │ │ ├── log_err_str.txt
│ │ │ ├── main.go
│ │ │ └── parser.go
│ │ └── README.md
│ └── questions/
│ └── README.md
├── LICENSE
├── README.md
├── advfuncs/
│ ├── 01-variadic-funcs/
│ │ └── main.go
│ ├── 02-func-values/
│ │ └── main.go
│ ├── 03-func-to-func/
│ │ └── main.go
│ ├── 04-closures/
│ │ └── main.go
│ ├── 05-higher-order-funcs/
│ │ └── main.go
│ ├── 06-functional-programming/
│ │ └── main.go
│ ├── 07-deferred-funcs/
│ │ └── main.go
│ ├── 08-png-detector/
│ │ └── main.go
│ ├── 08-png-detector-with-panic/
│ │ └── main.go
│ ├── 10-image-detector-recover/
│ │ └── main.go
│ ├── 10b-named-params/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-refactor/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── new/
│ └── 01-intro/
│ ├── funcval/
│ │ └── main.go
│ └── passfunc/
│ └── main.go
├── assets/
│ └── database.json
├── concurrency/
│ └── xxx-monte-carlo/
│ └── main.go
├── etc/
│ ├── FIX.md
│ └── stratch/
│ └── main.go
├── first/
│ ├── README.md
│ ├── explain/
│ │ ├── comments/
│ │ │ └── main.go
│ │ ├── expressions/
│ │ │ ├── 01-operator/
│ │ │ │ └── main.go
│ │ │ ├── 02-call-expression/
│ │ │ │ └── main.go
│ │ │ └── README
│ │ ├── importing/
│ │ │ ├── 01-file-scope/
│ │ │ │ └── main.go
│ │ │ └── 02-renaming/
│ │ │ └── main.go
│ │ ├── packages/
│ │ │ ├── scopes/
│ │ │ │ ├── bye.go
│ │ │ │ ├── hey.go
│ │ │ │ └── main.go
│ │ │ └── what/
│ │ │ ├── bye.go
│ │ │ ├── hey.go
│ │ │ └── main.go
│ │ ├── scopes/
│ │ │ ├── 01-scopes/
│ │ │ │ └── main.go
│ │ │ ├── 02-block-scope/
│ │ │ │ └── main.go
│ │ │ └── 03-nested-scope/
│ │ │ └── main.go
│ │ └── statements/
│ │ ├── 01-execution-flow/
│ │ │ └── main.go
│ │ └── 02-semicolons/
│ │ └── main.go
│ ├── first/
│ │ ├── exercises/
│ │ │ └── 01/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── main.go
│ │ └── questions/
│ │ ├── 01-code-your-first-program-questions.md
│ │ └── 02-run-your-first-program-questions.md
│ ├── printer/
│ │ ├── cmd/
│ │ │ └── main.go
│ │ └── printer.go
│ └── printer-exercise/
│ └── solution/
│ └── golang/
│ ├── cmd/
│ │ └── main.go
│ └── go.go
├── go.mod
├── go.sum
├── interfaces/
│ ├── 01-methods/
│ │ ├── book.go
│ │ ├── game.go
│ │ └── main.go
│ ├── 02-receivers/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── huge.go
│ │ └── main.go
│ ├── 03-nonstructs/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ └── money.go
│ ├── 04-interfaces/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── power/
│ │ │ ├── blender.go
│ │ │ ├── kettle.go
│ │ │ ├── main.go
│ │ │ ├── mixer.go
│ │ │ ├── player.go
│ │ │ └── socket.go
│ │ └── puzzle.go
│ ├── 05-type-assertion/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── puzzle.go
│ │ └── toy.go
│ ├── 06-empty-interface/
│ │ ├── book.go
│ │ ├── empty/
│ │ │ └── main.go
│ │ ├── empty2/
│ │ │ └── main.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── puzzle.go
│ │ └── toy.go
│ ├── 07-type-switch/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── puzzle.go
│ │ └── toy.go
│ ├── 08-promoted-methods/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── product.go
│ │ ├── puzzle.go
│ │ └── toy.go
│ ├── 09-little-refactor/
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── product.go
│ │ └── timestamp.go
│ ├── 10-stringer/
│ │ ├── _handlemethods.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── product.go
│ │ └── timestamp.go
│ ├── 11-sort/
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── product.go
│ │ └── timestamp.go
│ ├── 12-marshaler/
│ │ ├── database.json
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── product.go
│ │ └── timestamp.go
│ ├── 13-io/
│ │ ├── alice.txt
│ │ └── main.go
│ ├── 14-io-reusable/
│ │ └── main.go
│ ├── 15-png-detector/
│ │ ├── .gitignore
│ │ └── main.go
│ ├── 16-io-compose/
│ │ ├── .gitignore
│ │ └── main.go
│ ├── 17-write-an-io-reader/
│ │ ├── .gitignore
│ │ ├── main.go
│ │ └── reader.go
│ └── 18-testing/
│ ├── .gitignore
│ ├── main.go
│ ├── reader.go
│ └── reader_test.go
├── logparser/
│ ├── functional/
│ │ ├── Makefile
│ │ ├── chartwriter.go
│ │ ├── field.go
│ │ ├── filters.go
│ │ ├── groupers.go
│ │ ├── main.go
│ │ ├── pipeline.go
│ │ ├── result.go
│ │ ├── textreader.go
│ │ └── textwriter.go
│ ├── logs/
│ │ ├── Makefile
│ │ ├── log.jsonl
│ │ ├── log.txt
│ │ ├── log_err_missing.jsonl
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.jsonl
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.jsonl
│ │ └── log_err_str.txt
│ ├── testing/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ ├── main_test.go
│ │ ├── report/
│ │ │ ├── parser.go
│ │ │ ├── parser_test.go
│ │ │ ├── result.go
│ │ │ ├── summary.go
│ │ │ └── summary_test.go
│ │ └── summarize.go
│ ├── v1/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ └── main.go
│ ├── v2/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ └── main.go
│ ├── v3/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── v4/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── v5/
│ │ ├── Makefile
│ │ ├── filepipe.go
│ │ ├── main.go
│ │ ├── passthrough.go
│ │ └── pipe/
│ │ ├── chartreport.go
│ │ ├── close.go
│ │ ├── filter.go
│ │ ├── filters.go
│ │ ├── group.go
│ │ ├── groupers.go
│ │ ├── jsonlog.go
│ │ ├── jsonreport.go
│ │ ├── logcount.go
│ │ ├── pipe.go
│ │ ├── pipeline.go
│ │ ├── record.go
│ │ ├── recordshare.go
│ │ ├── textlog.go
│ │ └── textreport.go
│ └── v6/
│ ├── logly/
│ │ ├── parse/
│ │ │ ├── count.go
│ │ │ ├── json.go
│ │ │ ├── parser.go
│ │ │ └── text.go
│ │ ├── record/
│ │ │ ├── json.go
│ │ │ ├── record.go
│ │ │ ├── sum.go
│ │ │ ├── text.go
│ │ │ └── validate.go
│ │ └── report/
│ │ ├── json.go
│ │ └── text.go
│ └── main.go
├── magic/
│ └── detect.go
├── magicpanic/
│ └── detect.go
├── main.go
├── translation/
│ ├── README.md
│ ├── chinese/
│ │ ├── 01-安装与介绍/
│ │ │ ├── README.md
│ │ │ ├── osx-安装指南.md
│ │ │ ├── ubuntu-安装指南.md
│ │ │ ├── windows-安装指南.md
│ │ │ └── 学习路线.md
│ │ ├── 02-编写第一个程序/
│ │ │ ├── README.md
│ │ │ ├── main.go
│ │ │ ├── 带注释的 GO 程序.md
│ │ │ ├── 练习/
│ │ │ │ ├── 01-print-names/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ └── README.md
│ │ │ └── 问题/
│ │ │ ├── 01-gopath/
│ │ │ │ └── README.md
│ │ │ ├── 02-code-your-first-program/
│ │ │ │ └── README.md
│ │ │ └── 03-run-your-first-program/
│ │ │ └── README.md
│ │ ├── 03-包和作用域/
│ │ │ ├── 01-packages/
│ │ │ │ ├── bye.go
│ │ │ │ ├── hey.go
│ │ │ │ └── main.go
│ │ │ ├── 02-scopes/
│ │ │ │ ├── 01-scopes/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-block-scope/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-nested-scope/
│ │ │ │ │ └── main.go
│ │ │ │ └── 04-package-scope/
│ │ │ │ ├── bye.go
│ │ │ │ ├── hey.go
│ │ │ │ └── main.go
│ │ │ ├── 03-importing/
│ │ │ │ ├── 01-file-scope/
│ │ │ │ │ ├── bye.go
│ │ │ │ │ └── main.go
│ │ │ │ └── 02-renaming/
│ │ │ │ └── main.go
│ │ │ ├── 练习/
│ │ │ │ ├── 01-packages/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ ├── bye.go
│ │ │ │ │ ├── greet.go
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-scopes/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── printer.go
│ │ │ │ ├── 03-importing/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ └── README.md
│ │ │ └── 问题/
│ │ │ ├── 01-packages-A/
│ │ │ │ └── README.md
│ │ │ ├── 02-packages-B/
│ │ │ │ └── README.md
│ │ │ └── 03-scopes/
│ │ │ └── README.md
│ │ ├── 04-语句-表达式-注释/
│ │ │ ├── 01-statements/
│ │ │ │ ├── 01-execution-flow/
│ │ │ │ │ └── main.go
│ │ │ │ └── 02-semicolons/
│ │ │ │ └── main.go
│ │ │ ├── 02-expressions/
│ │ │ │ ├── 01-operator/
│ │ │ │ │ └── main.go
│ │ │ │ └── 02-call-expression/
│ │ │ │ └── main.go
│ │ │ ├── 03-comments/
│ │ │ │ └── main.go
│ │ │ ├── 练习/
│ │ │ │ ├── 01-shy-semicolons/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-naked-expression/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-operators-combine/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 04-print-go-version/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 05-comment-out/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 06-use-godoc/
│ │ │ │ │ ├── exercise.md
│ │ │ │ │ └── solution/
│ │ │ │ │ └── solution.md
│ │ │ │ └── README.md
│ │ │ └── 问题/
│ │ │ ├── 01-statements/
│ │ │ │ └── README.md
│ │ │ ├── 02-expressions/
│ │ │ │ └── README.md
│ │ │ └── 03-comments/
│ │ │ └── README.md
│ │ ├── 05-编写你的第一个库程序包/
│ │ │ ├── printer/
│ │ │ │ ├── cmd/
│ │ │ │ │ └── main.go
│ │ │ │ └── printer.go
│ │ │ ├── 练习/
│ │ │ │ ├── README.md
│ │ │ │ └── solution/
│ │ │ │ └── golang/
│ │ │ │ ├── cmd/
│ │ │ │ │ └── main.go
│ │ │ │ └── go.go
│ │ │ └── 问题/
│ │ │ └── README.md
│ │ ├── 06-变量/
│ │ │ ├── 01-基础数据类型/
│ │ │ │ ├── main.go
│ │ │ │ ├── 练习/
│ │ │ │ │ ├── 01-print-the-literals/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-print-hexes/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── README.md
│ │ │ │ └── 问题/
│ │ │ │ └── README.md
│ │ │ ├── 02-声明/
│ │ │ │ ├── 01-声明语法/
│ │ │ │ │ ├── 01-语法/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-命名规则/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 03-声明顺序/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-声明示例/
│ │ │ │ │ ├── 01-int/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-float64/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 03-bool/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 04-string/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-零值/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 04-未使用的变量和空白标识符/
│ │ │ │ │ ├── 01-未使用的变量/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 02-空白标识符/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 05-多重声明/
│ │ │ │ │ ├── 01-多重声明/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 02-平行声明/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 06-例子/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 练习/
│ │ │ │ │ ├── 01-int/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-bool/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 03-float64/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 04-string/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 05-undeclarables/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 06-with-bits/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 07-multiple/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 08-multiple-2/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 09-unused/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 10-package-variable/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 11-wrong-doer/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── README.md
│ │ │ │ └── 问题/
│ │ │ │ ├── 01-what/
│ │ │ │ │ └── README.md
│ │ │ │ ├── 02-declaration/
│ │ │ │ │ └── README.md
│ │ │ │ ├── 03-unused-variables/
│ │ │ │ │ └── README.md
│ │ │ │ └── 04-zero-values/
│ │ │ │ └── README.md
│ │ │ ├── 03-简短声明/
│ │ │ │ ├── 01-初始化以及简短声明/
│ │ │ │ │ ├── 01-初始化/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-简短声明/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 03-编码示例/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-包作用域/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-多重简短声明/
│ │ │ │ │ ├── 01-声明/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-编码示例/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 03-重声明/
│ │ │ │ │ ├── 01/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 02-编码示例/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 04-简短-vs-正常/
│ │ │ │ │ ├── 01-声明/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 02-简短声明/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 练习/
│ │ │ │ │ ├── 01-short-declare/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-multiple-short-declare/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 03-multiple-short-declare-2/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 04-short-with-expression/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 05-short-discard/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 06-redeclare/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── README.md
│ │ │ │ └── 问题/
│ │ │ │ └── README.md
│ │ │ ├── 04-赋值/
│ │ │ │ ├── 01-概述/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 01-赋值/
│ │ │ │ │ ├── 01-赋值/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-强类型/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 03-例子/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 05-多重赋值/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 06-交换/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 07-路径/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 08-路径丢弃/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 09-路径简短声明/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 练习/
│ │ │ │ │ ├── 01-make-it-blue/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-vars-to-vars/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 03-assign-with-expressions/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 04-find-the-rectangle-perimeter/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 05-multi-assign/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 06-multi-assign-2/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 07-multi-short-func/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 08-swapper/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 09-swapper-2/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 10-discard-the-file/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── README.md
│ │ │ │ └── 问题/
│ │ │ │ └── README.md
│ │ │ ├── 05-类型转换/
│ │ │ │ ├── 01-破坏性的/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-正确的/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-数型转换/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 练习/
│ │ │ │ │ ├── 01-convert-and-fix/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-convert-and-fix-2/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 03-convert-and-fix-3/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 04-convert-and-fix-4/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 05-convert-and-fix-5/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── README.md
│ │ │ │ └── 问题/
│ │ │ │ └── questions.md
│ │ │ └── 06-问候员项目/
│ │ │ ├── 01-演示/
│ │ │ │ └── main.go
│ │ │ ├── 02-版本1/
│ │ │ │ └── main.go
│ │ │ ├── 03-版本2/
│ │ │ │ └── main.go
│ │ │ ├── 练习/
│ │ │ │ ├── 01-count-arguments/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-print-the-path/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-print-your-name/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 04-greet-more-people/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 05-greet-5-people/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── README.md
│ │ │ │ └── solution-to-the-lecture-exercise/
│ │ │ │ └── main.go
│ │ │ └── 问题/
│ │ │ └── questions.md
│ │ └── 07-打印/
│ │ ├── 01-介绍/
│ │ │ ├── 01-println-vs-printf/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 02-转义序列/
│ │ │ └── main.go
│ │ ├── 03-打印类型/
│ │ │ └── main.go
│ │ ├── 04-编程/
│ │ │ └── main.go
│ │ ├── 练习/
│ │ │ ├── 01-print-your-age/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-print-your-name-and-lastname/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-false-claims/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-print-the-temperature/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-double-quotes/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 06-print-the-type/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 07-print-the-type-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 08-print-the-type-3/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 09-print-the-type-4/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 10-print-your-fullname/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── 问题/
│ │ └── questions.md
│ └── spanish/
│ ├── 01-empecemos/
│ │ ├── README.md
│ │ ├── instalacion-osx.md
│ │ ├── instalacion-ubuntu.md
│ │ └── instalacion-windows.md
│ ├── 02-tu-primer-programa/
│ │ ├── README.md
│ │ ├── anotaciones-ejemplo-programa-go.md
│ │ ├── ejercicios/
│ │ │ ├── 01-imprimiendo-nombres/
│ │ │ │ ├── main.go
│ │ │ │ └── solucion/
│ │ │ │ └── main.go
│ │ │ ├── 02-imprimiendo-gopath/
│ │ │ │ ├── ejercicio.md
│ │ │ │ └── solucion/
│ │ │ │ └── solucion.md
│ │ │ └── README.md
│ │ └── main.go
│ ├── 03-paquetes-y-funciones/
│ │ ├── 01-paquetes/
│ │ │ ├── bye.go
│ │ │ ├── hey.go
│ │ │ └── main.go
│ │ ├── 02-funciones/
│ │ │ ├── 01-funciones/
│ │ │ │ └── main.go
│ │ │ ├── 02-bloque-de-funcion/
│ │ │ │ └── main.go
│ │ │ ├── 03-funciones-anidadas/
│ │ │ │ └── main.go
│ │ │ └── 04-funcion-del-paquete/
│ │ │ ├── bye.go
│ │ │ ├── hey.go
│ │ │ └── main.go
│ │ ├── 03-importando/
│ │ │ ├── 01-funcion-del-archivo/
│ │ │ │ ├── bye.go
│ │ │ │ └── main.go
│ │ │ └── 02-renombrando/
│ │ │ └── main.go
│ │ ├── ejercicios/
│ │ │ ├── 01-paquetes/
│ │ │ │ ├── main.go
│ │ │ │ └── solucion/
│ │ │ │ ├── bye.go
│ │ │ │ ├── greet.go
│ │ │ │ └── main.go
│ │ │ ├── 02-scopes/
│ │ │ │ ├── main.go
│ │ │ │ └── solucion/
│ │ │ │ ├── main.go
│ │ │ │ └── printer.go
│ │ │ ├── 03-importando/
│ │ │ │ ├── main.go
│ │ │ │ └── solucion/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── preguntas/
│ │ ├── 01-paquetes-A/
│ │ │ └── README.md
│ │ ├── 02-paquete-B/
│ │ │ └── README.md
│ │ └── 03-funciones/
│ │ └── README.md
│ └── README.md
└── x-tba/
├── README.md
├── foundations/
│ ├── 01-print-args/
│ │ ├── 01-printf/
│ │ │ └── main.go
│ │ └── main.go
│ ├── 02-variables/
│ │ ├── 01-basics/
│ │ │ └── main.go
│ │ ├── 02-short-discard/
│ │ │ └── main.go
│ │ ├── 03-conversion/
│ │ │ └── main.go
│ │ └── types/
│ │ └── main.go
│ ├── 03-if-switch-loop/
│ │ ├── 01-for-crunch-the-primes/
│ │ │ └── main.go
│ │ ├── 02-switch-months/
│ │ │ └── main.go
│ │ ├── 03-math-table-if-switch-loop/
│ │ │ └── main.go
│ │ ├── 04-lucky-number-if-for-switch/
│ │ │ └── main.go
│ │ └── 05-path-searcher-for-range/
│ │ └── main.go
│ ├── area-of-a-circle/
│ │ └── main.go
│ ├── calc/
│ │ ├── 01-shortdecl-int-conv/
│ │ │ └── main.go
│ │ ├── 02-if/
│ │ │ └── main.go
│ │ ├── 03-floats-conv/
│ │ │ └── main.go
│ │ ├── 04-error-handling/
│ │ │ └── main.go
│ │ ├── 05-switch/
│ │ │ └── main.go
│ │ ├── 06-switch/
│ │ │ └── main.go
│ │ ├── 07/
│ │ │ └── main.go
│ │ ├── 08-funcs/
│ │ │ └── main.go
│ │ ├── 09-packages/
│ │ │ ├── calc/
│ │ │ │ └── calc.go
│ │ │ └── main.go
│ │ └── calc-scanner/
│ │ ├── calculations.txt
│ │ └── main.go
│ ├── cels-to-fahr/
│ │ └── main.go
│ ├── counter/
│ │ └── main.go
│ ├── feet-to-meters/
│ │ └── main.go
│ ├── lookup/
│ │ └── main.go
│ └── volume-of-a-sphere/
│ └── main.go
├── project-png-parser/
│ └── png-parser-project/
│ ├── 1-png-anatomy-format.md
│ ├── 2-png-anatomy-example.md
│ └── main.go
├── slicing-allocs-gotcha/
│ ├── main.go
│ └── nums/
│ └── main.go
├── swapi-api-client/
│ ├── fetch/
│ │ └── main.go
│ ├── film.go
│ ├── main.go
│ ├── request.go
│ ├── starship.go
│ └── swapi.go
├── tictactoe/
│ ├── 00-print/
│ │ └── main.go
│ ├── 01-vars/
│ │ └── main.go
│ ├── 02-short-decl/
│ │ └── main.go
│ ├── 03-consts/
│ │ └── main.go
│ ├── 04-funcs/
│ │ └── main.go
│ ├── 05-testing/
│ │ ├── board_test.go
│ │ └── main.go
│ ├── 06-if-switch/
│ │ ├── board_test.go
│ │ └── main.go
│ ├── 07-loop/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── main.go
│ │ └── skin.go
│ ├── 08-multi-loop/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── main.go
│ │ └── skin.go
│ ├── 09-slices/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ └── skin.go
│ ├── 10-arrays/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ └── skin.go
│ ├── 11-randomization/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ └── skin.go
│ ├── 12-infinite-loop/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ └── skin.go
│ ├── 13-detect-winning/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── ending.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ └── skin.go
│ ├── 14-more-tests/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── ending.go
│ │ ├── ending_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ ├── play_test.go
│ │ └── skin.go
│ ├── 15-os-args/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── ending.go
│ │ ├── ending_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ ├── play_test.go
│ │ ├── skin.go
│ │ └── turn.go
│ └── 16-types/
│ ├── board.go
│ ├── board_test.go
│ ├── ending.go
│ ├── ending_test.go
│ ├── init.go
│ ├── main.go
│ ├── play.go
│ ├── play_test.go
│ ├── skin.go
│ └── turn.go
├── tictactoe-experiments/
│ ├── 00-without-bufio/
│ │ └── main.go
│ ├── 01-without-funcs/
│ │ └── main.go
│ ├── 02-with-funcs/
│ │ └── main.go
│ ├── 03-with-structs/
│ │ └── main.go
│ ├── 04-with-methods/
│ │ └── main.go
│ ├── 05-with-pointers/
│ │ └── main.go
│ ├── 06-refactor/
│ │ ├── game.go
│ │ ├── logger.go
│ │ ├── main.go
│ │ ├── resources.md
│ │ └── skins.go
│ └── README.md
└── wizards-structs/
├── marshal/
│ └── main.go
├── server/
│ ├── list.tmpl.html
│ ├── main.go
│ ├── store.go
│ └── templates.go
└── unmarshal/
└── main.go
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*.DS_Store
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
.vscode/*
================================================
FILE: 01-get-started/README.md
================================================
# GO INSTALLATION GUIDES
Please select your operating system below for the detailed installation instructions:
* [OS X](osx-installation.md)
* [Windows](windows-installation.md)
* [Linux (Ubuntu)](ubuntu-installation.md)
================================================
FILE: 01-get-started/osx-installation.md
================================================
# OS X INSTALLATION CHEATSHEET
## NOTE
If you have [homebrew](https://brew.sh) installed, you can easily install Go like so:
```
# if you don't have git install it like so:
brew install git
# then install go
brew install go
# add GOBIN path to your PATH in ~/.bash_profile
export PATH=${HOME}/go/bin:$PATH
```
## 1- Install Visual Studio Code Editor
1. Install it but don't open it yet.
2. Go to: [https://code.visualstudio.com](https://code.visualstudio.com)
3. Select OS X (Mac) and start downloading
4. Uncompress the downloaded file and move it to your `~/Applications` directory.
## 2- Install Git
1. Grab and run the installer. Go to: [https://git-scm.com/downloads](https://git-scm.com/downloads)
2. Select VSCode as the default editor
## 3- Install Go
1. Go to [https://golang.org/dl](https://golang.org/dl)
2. Select OS X (Mac)
3. Start the installer
## 4- Configure VS Code
1. Open VS Code; from the extensions tab at the left, search for "go" and install it
2. Close VS Code completely and open it up again
3. Go to View menu; select **Command Palette**
1. Or just press `cmd+shift+p`
2. Type: `go install`
3. Select _"Go: Install/Update Tools"_
4. Check all the checkboxes
4. After it's done, open the **Command Palette** again
1. Type: `shell`
2. Select: _"Install 'code' command in PATH"_
1. **NOTE:** You don't have to do this if you're on Windows.
## That's all! Enjoy! 🤩
<div style="page-break-after: always;"></div>
> For more tutorials: [https://blog.learngoprogramming.com](https://blog.learngoprogramming.com)
>
> Copyright © 2018 Inanc Gumus
>
> Learn Go Programming Course
>
> [Click here to read the license.](https://creativecommons.org/licenses/by-nc-sa/4.0/)
================================================
FILE: 01-get-started/programmers-roadmap.md
================================================
# PROGRAMMER'S ROADMAP
Hi!
If you're an experienced developer, you may want to watch only the following lectures. If you follow this roadmap, you will need to watch about 50 lectures instead of 180 lectures.
This course starts from the most basics than advances toward the end, step by step. So, the complexity of the topics increases on each level. I've intentionally designed it so to make it easy for everyone.
If you think some of the topics are easy for you, then watch the recap lectures, take the quizzes and exercises, and even skip the lectures in that section altogether, you can always come back to them later.
Enjoy!
## LECTURES
* **Write Your First Go Program**
* Please watch all the lectures.
* What is Go Doc?
* The lectures under "Write a Library Package".
* **Master the Type System of Go**
* Every Go type has a zero value
* What is a blank identifier?
* Let's declare a couple of variables!
* What is type inference?
* How to short declare multiple variables?
* Why can't you short declare a variable in the package-level?
* What is redeclaration?
* When to use a short declaration?
* Get input from command-line and learn about slices
* Learn the basics of os.Args
* Greet people using os.Args
* The lectures under "Print Formatted Output Using Printf".
* Convert Celsius to Fahrenheit
* Convert Feet to Meters
* What is a Raw String Literal?
* How to get the length of a string?
* The lectures after "What is a Predeclared Type?" and to the end of the section.
* The following lectures under "Understand Untyped Constants"
* Learn the rules of constants
* Recap: Constants
* How untyped constants work under the hood?
* What is a Default Type?
* Example: time.Duration
* What is iota?
* Naming Things: Recommendations
* **Control Flow and Error Handling**
* Watch all the lectures under "Pass Me: Create a Password-Protected Program"
* Watch all the lectures under "Understand Go's Error Handling"
* Use multiple values in case conditions
* How does the fallthrough statement work?
* Solution: Parts of a Day
* Recap: Switch Statement
* How to continue a loop? (+BONUS: Debugging)
* Create a multiplication table
* How to loop over a slice?
* For Range: Learn the easy way!
* **Projects: For Beginners**
* Please watch all the lectures.
* **Remaining Sections**
* You may watch all the remaining lectures from this point. They are intermediate to advanced level lectures.
## That's all! Enjoy! 🤩
---
# BONUS: Why should you learn Go?
**In summary:** Go is easy as Python and Javascript , and it's as fast as C/C++. It's more enjoyable to work with Go than C/C++. You can go low-level, or you can stay high-level.
## What Go is used for?
Go is used mostly by web companies: Google, Facebook, Twitter, Uber, Apple, Dropbox, Soundcloud, Medium, Mozilla Firefox, Github, Docker, Kubernetes, and Heroku.
**Go is best for:** Cross-Platform Command-line Tools, Distributed Network Applications, Cloud technologies like Microservices and Serverless, Web APIs, Database Engines, Big-Data Processing Pipelines, Embedded Development, and so on.
**Go is not best for (but doable):** Desktop Apps, Writing Operating Systems, Kernel Drivers, Game Development, etc.
## Who Designed Go?
Go designed by one of the most influential people in the industry:
* Unix: Ken Thompson
* UTF-8, Plan 9: Rob Pike
* Hotspot JVM (Java Virtual Machine): Robert Griesemer
## HOW MUCH CAN YOU EARN?
* [Go Salaries](https://www.payscale.com/research/US/Skill=Go_(Golang)_Programming_Language/Salary)
## [From Eight years of Go post](https://blog.golang.org/8years):
> Today, **every single cloud company has critical components of their cloud infrastructure implemented in Go** including Google Cloud, AWS, Microsoft Azure, Heroku, and many others. Go is a key part of cloud companies like Alibaba, Cloudflare, and Dropbox. Go is a critical part of open infrastructure including Kubernetes, Cloud Foundry, Openshift, NATS, Docker, Istio, Etcd, Consul, Juju, and many more. Companies are increasingly choosing Go, to build cloud infrastructure solutions.
## What Can You Accomplish with Go?
* [A network Driver written in Go](https://www.net.in.tum.de/fileadmin/bibtex/publications/theses/2018-ixy-go.pdf) (_only 10% penalty compared to C driver_)
* [Google gVisor](https://cloud.google.com/blog/products/gcp/open-sourcing-gvisor-a-sandboxed-container-runtime) (_Userspace kernel written in Go_)
* [Multi-platform Nintendo emulator](https://humpheh.github.io/goboy/)
* [Docker: Container system](https://github.com/moby/moby)
* [Kubernetes: Container scheduling and management](https://github.com/kubernetes/kubernetes)
* VM image deduplication utility
* Chat server
* RUM beacon collector
* Time-series database engine, a client for it, command-line tools, etc.
* Map-reduce library
* Clustered front-end-optimizing reverse proxy with on the fly content rewriting, image resizing, caching, Lua event handler execution (all multi-tenant)
* Geographically distributed reverse proxy CDN nodes
* Health management daemon with event handlers and peer to peer reporting
* Pure Go DNS server
* API backend that interfaces with MySQL
* Linux process capture/restore utility
* Reverse Proxy to mask our asset server from clients.
* HTML -> PDF converter for invoice generation.
* URL shortener like tinyurl.com and goo.gl
* SMS messaging service.
* Credit Card payment gateway
* JSON Web Token package
* On the fly image processing services
* 3d render farm/content production pipeline (pretty large project)
* Production lxc container deployment
* Automated testing management
Reference: [This Reddit post](https://www.reddit.com/r/golang/comments/5nac2b/what_have_you_used_go_for_in_your_professional/).
## CHECK OUT FOR MORE INFORMATION:
* [About Go: An Overview](https://blog.learngoprogramming.com/about-go-language-an-overview-f0bee143597c)
* [Why should you learn Go?](https://medium.com/@kevalpatel2106/why-should-you-learn-go-f607681fad65)
* [Emerging language of cloud Infrastructure](https://redmonk.com/dberkholz/2014/03/18/go-the-emerging-language-of-cloud-infrastructure/)
* [Companies using Go](https://github.com/golang/go/wiki/GoUsers)
* [Eight years of Go](https://blog.golang.org/8years)
* [Twitter: Handling Five Billion Session in a Day with Go](https://blog.twitter.com/engineering/en_us/a/2015/handling-five-billion-sessions-a-day-in-real-time.html)
* [A C++ developer looks at Go](https://www.murrayc.com/permalink/2017/06/26/a-c-developer-looks-at-go-the-programming-language-part-1-simple-features/)
<div style="page-break-after: always;"></div>
> For more tutorials: [https://blog.learngoprogramming.com](https://blog.learngoprogramming.com)
>
> Copyright © 2019 Inanc Gumus
>
> Learn Go Programming Course
>
> [Click here to read the license.](https://creativecommons.org/licenses/by-nc-sa/4.0/)
================================================
FILE: 01-get-started/ubuntu-installation.md
================================================
# Linux Installation Cheatsheet
If you want to use snap, you can easily install Go like so:
sudo snap install go --classic
Otherwise, please follow the steps below:
## 1. Update the local packages
```bash
sudo apt-get update
```
## 2. Install git
```bash
sudo apt-get install git
```
## 3. Install Go
There are two ways:
1- From Web: Select Linux and the download will begin.
```bash
firefox https://golang.org/dl
```
2- By using snap: If you use this option, skip to the 5th step.
```bash
sudo snap install go --classic
```
## 4. Copy Go into the proper directory
1. Find out the name of the downloaded file
2. Use that filename to uncompress it
```bash
gofile="DELETE_THIS_AND_TYPE_THE_NAME_OF_THE_DOWNLOADED_FILE_HERE (without its extension)"
tar -C /usr/local -xzf ~/Downloads/$gofile
```
## 5. Add Go executables directory to your PATH
1. Add `go/bin` directory to `$PATH` to be able to run the fundamental Go commands.
```bash
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
```
2. Add "$HOME/go/bin" directory to $PATH
```bash
echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.profile
```
## Install Go Tools:
* These are very handy tools to ease the development (like goimports)
* `go get` cannot be used without installing a code versioning program like Git which we already have got it above.
* This will create `~/go` directory and will download go tools into there.
* This directory is also a place where you should put your code into.
(If you're not going to use Go Modules)
```bash
go get -v -u golang.org/x/tools/...
```
## Install VSCode (Optional)
Note: You may use another coding editor if you like. However, the course uses Visual Studio Code (VSCode).
1. Open "Ubuntu Software" application
2. Search for VSCode then click "Install"
## OPTIONAL STEP:
1. Create a hello.go file in a new directory but anywhere outside of `$GOPATH`
```bash
cat <<EOF > hello.go
package main
import "fmt"
func main() {
fmt.Println("hello gopher!")
}
EOF
```
2. Run the program
```bash
go run hello.go
It should print: hello gopher!
```
<div style="page-break-after: always;"></div>
> For more tutorials: [https://blog.learngoprogramming.com](https://blog.learngoprogramming.com)
>
> Copyright © 2018 Inanc Gumus
>
> Learn Go Programming Course
>
> [Click here to read the license.](https://creativecommons.org/licenses/by-nc-sa/4.0/)
================================================
FILE: 01-get-started/windows-installation.md
================================================
# WINDOWS INSTALLATION CHEATSHEET
## NOTE
If you have [chocolatey.org](https://chocolatey.org/) package manager, you can easily install Go like so:
```
choco install golang
```
## 1- Install Visual Studio Code Editor
1. Install it but don't open it yet.
2. Go to: [https://code.visualstudio.com](https://code.visualstudio.com)
3. Select Windows and start downloading
4. Run the installer
## 2- Install Git
1. Grab and run the installer. Go to: [https://gitforwindows.org](https://gitforwindows.org)
2. Select VSCode as the default editor
3. Enable all the checkboxes
4. Select: _"Use Git from the Windows Command Prompt"_
5. Encodings: Select: _"Checkout as is..." option._
## 3- Install Go
1. Go to [https://golang.org/dl](https://golang.org/dl)
2. Select Windows and download
3. Start the installer
## 4- Configure VS Code
1. Open VS Code; from the extensions tab at the left, search for "go" and install it
2. Close VS Code completely and open it up again
3. Go to View menu; select **Command Palette**
1. Or just press `ctrl+shift+p`
2. Type: `go install`
3. Select _"Go: Install/Update Tools"_
4. Check all the checkboxes
## 5- Using Git-Bash
* In this course I'll be using bash commands. Bash is just a command-line interface used in OS X and Linux. It's one of the most popular command-line interfaces. So, if you want to use it too, instead of using the Windows default command-line, you can use git bash that you've installed. With git bash, you can type a command in command-line as you're on OS X or Linux.
* If you don't want to use git bash, it's ok too. It depends on you. But note that, I'll be using bash commands mostly. Because it allows more advanced commands as well.
* You can also prefer to use the more powerful alternative to git bash: [Linux Subsystem for Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
* **So, to use git bash, follow these steps:**
1. Just search for git bash from the start bar
2. Or, if there's one, click on the icon on your desktop
3. Also, setup VS Code to use git-bash by default:
1. Open VS Code
2. Go to Command Palette
1. Type: `terminal`
2. Select: _"Terminal: Select Default Shell"_
3. And, Select: _"Git Bash"_
4. **NOTE:** Normally, you can find your files under `c:\`, however, when you're using git bash, you'll find them under `/c/` directory. It's actually the very same directory, it's just a shortcut.
## That's all! Enjoy! 🤩
<div style="page-break-after: always;"></div>
> For more tutorials: [https://blog.learngoprogramming.com](https://blog.learngoprogramming.com)
>
> Copyright © 2018 Inanc Gumus
>
> Learn Go Programming Course
>
> [Click here to read the license.](https://creativecommons.org/licenses/by-nc-sa/4.0/)
================================================
FILE: 02-write-your-first-program/README.md
================================================
# Cheatsheet: Write your First Go Program
Hi!
For reference, you can store this cheatsheet after you take the lectures in this section.
You can also print this cheatsheet and then follow the video lectures in this section along with it.
Enjoy!
---
## COMMAND LINE COMMANDS:
* Enter into a directory: `cd directoryPath`
* **WINDOWS:**
* List files in a directory: `dir`
* **OS X & LINUXes:**
* List files in a directory: `ls`
## BUILDING & RUNNING GO PROGRAMS:
* **Build a Go program:**
* While inside a program directory, type:
* `go build main.go`
* **Run a Go program:**
* While inside a program directory, type:
* `go run main.go`
## WHERE YOU SHOULD PUT YOUR SOURCE FILES?
* In any directory you like.
## FIRST PROGRAM
### Create a directory
* Create a new directory:
* `mkdir myDirectoryName`
* Go to that directory:
* `cd myDirectoryName`
### Add the source code files
* Create a new `code main.go` file.
* This is going to the create the file in the folder, and open up it in the Visual Studio Code.
* And add the following code to it and save it.
```go
package main
import "fmt"
func main() {
fmt.Println("Hi! I want to be a Gopher!")
}
```
### Run the program
* Finally, return back to the command-line.
* Run it like this: `go run main.go`
* If you create other files and run them all, you can use this command:
* `go run .`
That's all! Enjoy!
> For more tutorials: [https://blog.learngoprogramming.com](https://blog.learngoprogramming.com)
>
> Copyright © 2018 Inanc Gumus
>
> Learn Go Programming Course
>
> [Click here to read the license.](https://creativecommons.org/licenses/by-nc-sa/4.0/)
================================================
FILE: 02-write-your-first-program/annotated-go-program-example.md
================================================
# Annotated Example Go Program
```go
// package main is a special package
// it allows Go to create an executable file
package main
/*
This is a multi-line comment.
import keyword makes another package available
for this .go "file".
import "fmt" lets you access fmt package's functionality
here in this file.
*/
import "fmt"
// "func main" is special.
//
// Go has to know where to start
//
// func main creates a starting point for Go
//
// After compiling the code,
// Go runtime will first run this function
func main() {
// after: import "fmt"
// Println function of "fmt" package becomes available
// Look at what it looks like by typing in the console:
// go doc -src fmt Println
// Println is just an exported function from
// "fmt" package
// Exported = First Letter is uppercase
fmt.Println("Hello Gopher!")
// Go cannot call Println function by itself.
// That's why you need to call it here.
// It only calls `func main` automatically.
// -----
// Go supports Unicode characters in string literals
// And also in source-code: KÖSTEBEK!
//
// Because: Literal ~= Source Code
}
```
<div style="page-break-after: always;"></div>
> For more tutorials: [https://blog.learngoprogramming.com](https://blog.learngoprogramming.com)
>
> Copyright © 2018 Inanc Gumus
>
> Learn Go Programming Course
>
> [Click here to read the license.](https://creativecommons.org/licenses/by-nc-sa/4.0/)
================================================
FILE: 02-write-your-first-program/exercises/01-print-names/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Print names
//
// Print your name and your best friend's name using
// Println twice
//
// EXPECTED OUTPUT
// YourName
// YourBestFriendName
//
// BONUS
// Use `go run` first.
// And after that use `go build` and run your program.
// ---------------------------------------------------------
func main() {
// ?
// ?
}
================================================
FILE: 02-write-your-first-program/exercises/01-print-names/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
// go run main.go
// go build
// ./solution
func main() {
fmt.Println("Nikola")
fmt.Println("Thomas")
}
================================================
FILE: 02-write-your-first-program/exercises/README.md
================================================
1. **Print your name and your best friend's name** using Println twice. [Check out this exercise here](https://github.com/inancgumus/learngo/tree/master/02-write-your-first-program/exercises/01-print-names).
2. **Say hello to yourself.**
1. Build your program using `go build`
2. **Send it to your friend**
S/he should use be using the same operating system.
For example, if you're using Windows, then hers/his should be Windows as well.
3. **Send your program to a friend with a different operating system**
So, you should compile your program for her operating system.
**Create an OSX executable:**
`GOOS=darwin GOARCH=386 go build`
**Create a Windows executable:**
`GOOS=windows GOARCH=386 go build`
**Create a Linux executable:**
`GOOS=linux GOARCH=arm GOARM=7 go build`
**You can find the full list in here:**
https://golang.org/doc/install/source#environment
**NOTE:** If you're using the command prompt or the PowerShell, you may need to use it like this:
`cmd /c "set GOOS=darwin GOARCH=386 && go build"`
3. **Call [Print](https://golang.org/pkg/fmt/#Print) instead of [Println](https://golang.org/pkg/fmt/#Println)** to see what happens.
4. **Call [Println](https://golang.org/pkg/fmt/#Println) or [Print](https://golang.org/pkg/fmt/#Print) with multiple values** by separating them using commas.
5. **Remove the double quotes from a string literal** and see what happens.
6. **Move the package and import statement** to the bottom of the file and see what happens.
7. **[Read Go online documentation](https://golang.org/pkg)**.
1. Take a quick look at the packages and read what they do.
2. Look at their source-code by clicking on their titles.
3. You don't have to understand everything, just do it. This will warm you up for the upcoming lectures.
8. Also, **take a tour on**: https://tour.golang.org/
1. Have a quick look. Check out the language features.
2. We're going to talk all about them soon.
9. [Follow me on twitter to learn more](https://twitter.com/inancgumus).
================================================
FILE: 02-write-your-first-program/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
// package main is a special package
// it allows Go to create an executable file
package main
/*
This is a multi-line comment.
import keyword makes another package available
for this .go "file".
import "fmt" lets you access fmt package's functionality
here in this file.
*/
import "fmt"
// "func main" is special.
//
// Go has to know where to start
//
// func main creates a starting point for Go
//
// After compiling the code,
// Go runtime will first run this function
func main() {
// after: import "fmt"
// Println function of "fmt" package becomes available
// Look at what it looks like by typing in the console:
// go doc -src fmt Println
// Println is just an exported function from
// "fmt" package
// Exported = First Letter is uppercase
fmt.Println("Hello Gopher!")
// Go cannot call Println function by itself.
// That's why you need to call it here.
// It only calls `func main` automatically.
// -----
// Go supports Unicode characters in string literals
// And also in source-code: KÖSTEBEK!
//
// Because: Literal ~= Source Code
// EXERCISE: Remove the comments from below --> //
// fmt.Println("Merhaba Köstebek!")
// Unnecessary note:
// "Merhaba Köstebek" means "Hello Gopher"
// in Turkish language
}
================================================
FILE: 02-write-your-first-program/questions/01-gopath/README.md
================================================
## Where should you save your Go source code?
* Anywhere on my computer
* Under $GOPATH
* Under $GOPATH/src *CORRECT*
## What does $GOPATH mean?
* It's a file for Go runtime
* Stores Go source code files and compiled packages
* It's a path for gophers to follow
## Do you need to set $GOPATH?
* Yes
* No: It's stored on my desktop
* No: It's stored under my user path *CORRECT*
## How can you print $GOPATH?
* Using `ls` command
* Using `go env GOPATH` command *CORRECT*
* Using `go environment` command
================================================
FILE: 02-write-your-first-program/questions/02-code-your-first-program/README.md
================================================
## Which keyword below that you need use to define a package?
```go
package main
func main() {
}
```
1. func
2. package *CORRECT*
3. fmt.Println
4. import
> **1:** func keyword is used to declare a new function.
>
>
> **2:** That's right! package keyword allows you to define a package for a Go file.
>
>
> **3:** It's not a keyword, it's a function of the fmt package.
>
>
> **4:** import keyword is used to import a package.
>
>
## What is the purpose of using package main in the following program?
```go
package main
func main() {
}
```
* To create a library package
* To properly exit from the program
* To create an executable Go program *CORRECT*
## What is the purpose of func main in the following program?
```go
package main
func main() {
}
```
1. It defines a package called main
2. It allows Go to start executing the program *CORRECT*
3. It prints a message to the console
> **1:** main function doesn't create a package.
>
>
> **2:** That's right. Go automatically calls the main function to execute a program.
>
>
> **3:** It doesn't print anything (at least directly).
>
>
## What is the purpose of import "fmt" in the following program?
```go
package main
import "fmt"
func main() {
fmt.Println("Hi!")
}
```
1. It prints "fmt" to the console
2. It defines a new package called "fmt"
3. It imports the `fmt` package; so you can use its functionalities *CORRECT*
> **1:** `fmt.Println` prints a message not the `import "fmt"`.
>
>
> **2:** `package` keyword does that, not the `import` keyword.
>
>
> **3:** Yes. For example, after you import the fmt package you can call its Println function to print a message to the console.
>
>
## Which keyword is used to declare a new function?
* func *CORRECT*
* package
* Println
* import
## What is a function?
1. It's like a mini-program. It's a reusable and executable block of code. *CORRECT*
2. It allows Go to execute a program.
3. It allows Go to import a package called function.
4. It prints a message to the console.
> **2:** Go looks for package main and func main to do that. A function doesn't do that on its own.
>
>
> **3:** `import` keyword does that.
>
>
> **4:** For example: `fmt.Println` does that.
>
>
## Do you have to call the main function yourself?
1. Yes, so that, I can execute my program.
2. No, Go calls the main function automatically. *CORRECT*
> **1:** No, you don't need to call the main function. Go automatically executes it.
>
>
## Do you have to call a function to execute it?
_(except the main func)_
1. Yes, so that, Go can execute that function. *CORRECT*
2. Yes, so that, Go can execute my program.
3. No, Go calls the functions automatically.
> **1:** That's right. You need to call a function yourself. Go won't execute it automatically. Go only calls the main function automatically (and some other functions which you didn't learn about yet).
>
>
> **2:** That's only the job of the `func main`. There's only one `func main`.
>
>
> **3:** Go doesn't call any function automatically except the main func (and some other functions which you didn't learn about yet). So, except the main func, you need to call the functions yourself.
>
## What does the following program print?
```go
package main
func main() {
}
```
1. It prints a message to the console
2. It's a correct program but it doesn't print anything *CORRECT*
3. It's an incorrect program
> **1:** It doesn't print a message. To do that you can use fmt.Println function.
>
>
> **2:** Yes, it's a correct program, however since it doesn't contain fmt.Println it doesn't print anything.
>
>
> **3:** It's a correct program. It uses the package keyword and it has a main function. So, this is a valid and an executable Go program.
>
>
## What does this program print?
```go
package main
func main() {
fmt.Println(Hi! I want to be a Gopher!)
}
```
* Hi! I want to be a Gopher!
* It doesn't print anything
* This program is incorrect *CORRECT*
> **1:** It doesn't pass the message to Println wrapped between double-quotes. It should be like: fmt.Println("Hi! I want to be a Gopher")
>
>
> **3:** It doesn't import "fmt" package. Also see #1.
>
>
## What does this program print?
```go
package main
import "fmt"
func main() {
fmt.Println("Hi there!")
}
```
* Hi there! *CORRECT*
* fmt
* This program is incorrect; it imports the wrong package or there isn't a function called `Println`
> **2:** import "fmt" imports the `fmt` package; so you can use its functionalities.
>
>
> **3:** Actually, this program is correct.
>
>
================================================
FILE: 02-write-your-first-program/questions/03-run-your-first-program/README.md
================================================
## What is the difference between `go build` and `go run`?
1. `go run` just compiles a program; whereas `go build` both compiles and runs it.
2. `go run` both compiles and runs a program; whereas `go build` just compiles it. *CORRECT*
> **1:** It's opposite actually.
>
>
> **2:** `go run` compiles your program and puts it in a temporary directory. Then it runs the compiled program in there.
>
>
## Go saves the compiled code in a directory. What is the name of that directory?
1. The same directory where you call `go build` *CORRECT*
2. $GOPATH/src directory
3. $GOPATH/pkg directory
4. Into a temporary directory.
> **2:** There only lives Go source-code files
>
>
> **3:** Go only puts your code there when you call `go install`.
>
>
## Which is true for runtime?
1. It happens when your program starts running on a computer *CORRECT*
2. It happens while your program is being compiled
## Which is true for the compile-time?
1. It happens when your program starts running on a computer
2. It happens while your program is being compiled *CORRECT*
## When can a Go program print a message to the console?
1. While it's being compiled.
2. While it runs (after compile-time). *CORRECT*
3. While it runs (inside the compile-time).
> **1:** In the compilation step your program cannot print a message. In that stage, it's literally dead.
>
>
> **2:** That's right. That's the only time which your program can interact with a computer and instruct it to print a message to the console.
>
>
> **3:** Running can only happen after the compile-time
>
>
================================================
FILE: 03-packages-and-scopes/01-packages/bye.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func bye() {
fmt.Println("Bye!")
}
================================================
FILE: 03-packages-and-scopes/01-packages/hey.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func hey() {
fmt.Println("Hey!")
}
================================================
FILE: 03-packages-and-scopes/01-packages/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
fmt.Println("Hello!")
// You can access functions from other files
// which are in the same package
// Here, `main()` can access `bye()` and `hey()`
// It's because bye.go, hey.go and main.go
// are in the main package.
bye()
hey()
}
================================================
FILE: 03-packages-and-scopes/02-scopes/01-scopes/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// file scope
import "fmt"
// package scope
const ok = true
// package scope
func main() { // block scope starts
var hello = "Hello"
// hello and ok are visible here
fmt.Println(hello, ok)
} // block scope ends
================================================
FILE: 03-packages-and-scopes/02-scopes/02-block-scope/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
func nope() { // block scope starts
// hello and ok are only visible here
const ok = true
var hello = "Hello"
_ = hello
} // block scope ends
func main() { // block scope starts
// hello and ok are not visible here
// ERROR:
// fmt.Println(hello, ok)
} // block scope ends
================================================
FILE: 03-packages-and-scopes/02-scopes/03-nested-scope/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
// I didn't talk about this in a lecture
// As a side-note, I wanted to put it here
// Please review it.
var declareMeAgain = 10
func nested() { // block scope starts
// declares the same variable
// they both can exist together
// this one only belongs to this scope
// package's variable is still intact
var declareMeAgain = 5
fmt.Println("inside nested:", declareMeAgain)
} // block scope ends
func main() { // block scope starts
fmt.Println("inside main:", declareMeAgain)
nested()
// package-level declareMeAgain isn't effected
// from the change inside the nested func
fmt.Println("inside main:", declareMeAgain)
} // block scope ends
================================================
FILE: 03-packages-and-scopes/02-scopes/04-package-scope/bye.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func bye() {
fmt.Println("Bye!")
}
================================================
FILE: 03-packages-and-scopes/02-scopes/04-package-scope/hey.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func hey() {
fmt.Println("Hey!")
}
================================================
FILE: 03-packages-and-scopes/02-scopes/04-package-scope/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
fmt.Println("Hello!")
// two files belong to the same package
// calling `bye()` of bye.go here
bye()
}
// EXERCISE: Remove the comments from the below function
// And analyze the error message
// func bye() {
// fmt.Println("Bye!")
// }
// ***** EXPLANATION *****
//
// ERROR: "bye" function "redeclared"
// in "this block"
//
// "this block" means = "main package"
//
// "redeclared" means = you're using the same name
// in the same scope again
//
// main package's scope is:
// all source-code files which are in the same main package
================================================
FILE: 03-packages-and-scopes/03-importing/01-file-scope/bye.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// Uncomment below code to see the error
// (Just remove the // characters for all 3 lines below)
// This file cannot see main.go's imported names ("fmt").
// Because the imported names belong to file scope.
// func bye() {
// fmt.Println("Bye!")
// }
================================================
FILE: 03-packages-and-scopes/03-importing/01-file-scope/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
fmt.Println("Hello!")
}
================================================
FILE: 03-packages-and-scopes/03-importing/02-renaming/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
import f "fmt"
func main() {
fmt.Println("Hello!")
f.Println("There!")
}
================================================
FILE: 03-packages-and-scopes/exercises/01-packages/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Use your own package
//
// Create a few Go files and call their functions from
// the main function.
//
// 1- Create main.go, greet.go and bye.go files
// 2- In main.go: Call greet and bye functions.
// 3- Run `main.go`
//
// HINT
// greet function should be in greet.go
// bye function should be in bye.go
//
// EXPECTED OUTPUT
// hi there
// goodbye
// ---------------------------------------------------------
func main() {
// call functions of the other files here
}
================================================
FILE: 03-packages-and-scopes/exercises/01-packages/solution/bye.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func bye() {
fmt.Println("goodbye")
}
================================================
FILE: 03-packages-and-scopes/exercises/01-packages/solution/greet.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func greet() {
fmt.Println("hi there")
}
================================================
FILE: 03-packages-and-scopes/exercises/01-packages/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
func main() {
greet()
bye()
}
================================================
FILE: 03-packages-and-scopes/exercises/02-scopes/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Try the scopes
//
// 1. Create two files: main.go and printer.go
//
// 2. In printer.go:
// 1. Create a function named hello
// 2. Inside the hello function, print your name
//
// 3. In main.go:
// 1. Create the usual func main
// 2. Call your function just by using its name: hello
// 3. Create a function named bye
// 4. Inside the bye function, print "bye bye"
//
// 4. In printer.go:
// 1. Call the bye function from
// inside the hello function
// ---------------------------------------------------------
func main() {
}
================================================
FILE: 03-packages-and-scopes/exercises/02-scopes/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// as you can see, I don't need to import a package
// and I can call `hello` function here.
//
// this is because, package-scoped names
// are shared in the same package
hello()
// but here, I can't access the fmt package without
// importing it.
//
// this is because, it's in the printer.go's file scope.
// it imports it.
// this main func can also call bye function here
// bye()
}
// printer.go can call this function
//
// this is because, bye function is in the package-scope
// of the main package now.
//
// main func can also call this.
func bye() {
fmt.Println("bye bye")
}
================================================
FILE: 03-packages-and-scopes/exercises/02-scopes/solution/printer.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func hello() {
// only this file can access the imported fmt package
// when others also do so, they can also access
// their own `fmt` "name"
fmt.Println("hi! this is inanc!")
bye()
}
================================================
FILE: 03-packages-and-scopes/exercises/03-importing/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Rename imports
//
// 1- Import fmt package three times with different names
//
// 2- Print a few messages using those imports
//
// EXPECTED OUTPUT
// hello
// hey
// hi
// ---------------------------------------------------------
// ?
// ?
// ?
func main() {
// ?
// ?
// ?
}
================================================
FILE: 03-packages-and-scopes/exercises/03-importing/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
import f "fmt"
import fm "fmt"
func main() {
fmt.Println("hello")
f.Println("hey")
fm.Println("hi")
}
================================================
FILE: 03-packages-and-scopes/exercises/README.md
================================================
1. **[Use your own package](https://github.com/inancgumus/learngo/tree/master/03-packages-and-scopes/exercises/01-packages)**
Create a few Go files and call their functions from the main function.
2. **[Try the scopes](https://github.com/inancgumus/learngo/tree/master/03-packages-and-scopes/exercises/02-scopes)**
Learn the effects of scoping across packages.
3. **[Rename imports](https://github.com/inancgumus/learngo/tree/master/03-packages-and-scopes/exercises/03-importing)**
Import the same package using a different name.
================================================
FILE: 03-packages-and-scopes/questions/01-packages-A/README.md
================================================
## Where to store the source code files that belong to a package?
1. Each file should go into a different directory
2. In a single directory *CORRECT*
## Why a package clause is used in a Go source-code file?
1. It's used for importing a package
2. It's used for letting Go know that the file belongs to a package *CORRECT*
3. It's used for declaring a new function
> **1:** `import` statement does that.
>
>
> **3:** `func` statement does that.
>
>
## Where you should put the `package clause` in a Go source-code file?
1. As the first code in a Go source code file *CORRECT*
2. As the last code in a Go source code file
3. You can put it anywhere
## How many times you can use `package clause` for a single source code file?
1. Once *CORRECT*
2. None
3. Multiple times
## Which one is a correct usage of `package clause`?
1. `my package`
2. `package main`
3. `pkg main`
## Which one is correct?
1. All files belong to the same package cannot call each others' functions
2. All files belong to the same package can call each others' functions *CORRECT*
## How to run multiple Go files?
1. go run *.*go
2. go build *go
3. go run go
4. go run *.go *CORRECT*
> **4:** You can also call it like (assuming there are file1.go file2.go and file3.go in the same directory): go run file1.go file2.go file3.go
>
>
================================================
FILE: 03-packages-and-scopes/questions/02-packages-B/README.md
================================================
## Which one below is a correct package type in Go?
* Empty package
* Executable package *CORRECT*
* Transferrable package
* Librarian package
## Which package type `go run` can execute?
* Empty package
* Executable package *CORRECT*
* Transferrable package
* Library package
## Which package type that `go build` can compile?
* Empty package
* Temporary package
* Both of executable and library packages *CORRECT*
* Transferrable package
## Which one is an executable package?
* `package main` with `func main` *CORRECT*
* `package Main` with `func Main`
* `package exec` with `func exec`
## Which one is a library package?
* `main package`
* `package lib` *CORRECT*
* `func package`
* `package main` with `func main`
## Which package is used for an executable Go program?
* Empty package
* Executable package *CORRECT*
* Transferrable package
* Library package
## Which package is used for reusability and can be imported?
* Empty package
* Executable package
* Transferrable package
* Library package *CORRECT*
================================================
FILE: 03-packages-and-scopes/questions/03-scopes/README.md
================================================
## What's a scope?
* Executable block of code
* The visibility of the declared names **CORRECT**
* Determines what to run
```go
package awesome
import "fmt"
var enabled bool
func block() {
var counter int
fmt.Println(counter)
}
```
## Which name below is package scoped?
1. awesome
2. fmt
3. enabled **CORRECT**
4. counter
> **3:** That's right. `enabled` is out of any functions, so it's a package scoped name. `block()` function is also package scoped; it's out of any function too.
>
>
## Which name below is file scoped?
1. awesome
2. fmt **CORRECT**
3. enabled
4. block()
5. counter
> **2:** That's right. Imported package names are file scoped. And they can only be used within the same file.
>
>
## Which name below is in the scope of the block() func?
1. awesome
2. fmt
3. enabled
4. block()
5. counter **CORRECT**
> **5:** That's right. `counter` is declared within the `block()` func, so it's in the scope of the block func. Out of the `block()` func, other code can't see it.
>
>
## Can `block()` see `enabled` name?
1. Yes: It's in the package scope **CORRECT**
2. No: It's in the file scope
3. No: It's in the block scope of block()
> **1:** All code inside the same package can see all the other package level declared names.
>
>
## Can other files in `awesome` package see `counter` name?
1. Yes
2. No: It's in the package scope
3. No: It's in the file scope
4. No: It's in the block scope of block() **CORRECT**
> **4:** That's right. None of the other code can see the names inside the `block()` function. Only the code inside the `block()` function can see them (Only to some extent. For example: Inside the block, the code can only see the variables declared before it.)
>
>
## Can other files in `awesome` package see `fmt` name?
1. Yes
2. No: It's in the package scope
3. No: It's in the file scope **CORRECT**
4. No: It's in the block scope of block()
> **3:** Only the same file can see the imported packages, not the other files whether they're in the same package or not.
>
>
## What happens if you declare the same name in the same scope as this:
```go
package awesome
import "fmt"
// declared twice in the package scope
var enabled bool
var enabled bool
func block() {
var counter int
fmt.Println(counter)
}
```
1. The newly declared name will override the previous one.
2. I can't do that. It's already been declared at the package scope. *CORRECT*
3. I can't do that. It's already been declared at the file scope.
> **2:** That's right. You can't declare the same name in the same scope. If you could do so, then how would you access it again? Or to which one?
>
>
## What happens if you declare the same name in another scope like this:
```go
package awesome
import "fmt"
// declared at the package scope
var enabled bool
func block() {
// also declared in the block scope
var enabled bool
var counter int
fmt.Println(counter)
}
```
1. The newly declared name will override the previous one. *CORRECT*
2. I can't do that. It's already been declared at the package scope.
3. I can't do that. It's already been declared at the file scope.
> **1:** Actually, you can declare the same name in the inner scopes like this. `block()`'s scope is inside its package. This means that it can access to its package's scope (but not vice versa). So, `block()`'s scope is under its package's scope. This means that you can declare the same name again. It will override the parent scope's name. They both can be exist together. Check out the example in the course repository to find out.
>
>
================================================
FILE: 04-statements-expressions-comments/01-statements/01-execution-flow/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello!")
// Statements change the execution flow
// Especially the control flow statements like `if`
if 5 > 1 {
fmt.Println("bigger")
}
}
================================================
FILE: 04-statements-expressions-comments/01-statements/02-semicolons/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello"); fmt.Println("World!")
}
================================================
FILE: 04-statements-expressions-comments/02-expressions/01-operator/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello!" + "!")
}
================================================
FILE: 04-statements-expressions-comments/02-expressions/02-call-expression/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"runtime"
)
func main() {
// runtime.NumCPU() is a call expression
fmt.Println(runtime.NumCPU() + 1)
}
================================================
FILE: 04-statements-expressions-comments/03-comments/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
// Package main makes this package an executable program
package main
import "fmt"
/*
main function
Go executes this program using this function.
There should be only one main file in the main package.
Executable programs are also called "commands".
*/
func main() {
fmt.Println("Hello Gopher!")
}
================================================
FILE: 04-statements-expressions-comments/exercises/01-shy-semicolons/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Shy Semicolons
//
// 1. Try to type your statements by separating them using
// semicolons
//
// 2. Observe how Go fixes them for you
//
// ---------------------------------------------------------
func main() {
}
================================================
FILE: 04-statements-expressions-comments/exercises/01-shy-semicolons/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
func main() {
// Uncomment the line of code below; then save the file.
//
// You will see that Gofmt tool will format your code automatically.
// https://golang.org/cmd/gofmt/
//
// This is because, for Go, it doesn't matter whether
// you use semicolons between the statements or not.
//
// It adds them automatically after all.
/*
fmt.Println("inanc"); fmt.Println("lina"); fmt.Println("ebru");
*/
}
================================================
FILE: 04-statements-expressions-comments/exercises/02-naked-expression/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Naked Expression
//
// 1. Try to type just "Hello" on a line.
// 2. Do not use Println
// 3. Observe the error
//
// ---------------------------------------------------------
func main() {
// ?
}
================================================
FILE: 04-statements-expressions-comments/exercises/02-naked-expression/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
func main() {
// Uncomment the code line below to see the error.
/*
"Hello"
*/
// It will say: "evaluted but not used"
//
// Because:
// "Hello" literal returns a value but there isn't any
// statement which uses it.
//
// So:
// You can't use expressions alone without statements.
}
================================================
FILE: 04-statements-expressions-comments/exercises/03-operators-combine/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Operators combine the expressions
//
// Print the expected output below using the string
// concatenation operator.
//
// HINT
// Use + operator multiple times to create "Hello!!!?".
//
// EXPECTED OUTPUT
// "Hello!!!?"
// ---------------------------------------------------------
func main() {
// fmt.Println("Hello!" + ?)
}
================================================
FILE: 04-statements-expressions-comments/exercises/03-operators-combine/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// Operators combine multiple expressions together
// as if there's a single expression.
fmt.Println("Hello!" + "!" + "!" + "?")
}
================================================
FILE: 04-statements-expressions-comments/exercises/04-print-go-version/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Print the Go Version
//
// 1. Look at the runtime package documentation
// 2. Find the func that returns the Go version
// 3. Print the Go version by calling that func
//
// HINT
// It's here: https://golang.org/pkg/runtime
//
// EXPECTED OUTPUT
// "go1.10"
// ---------------------------------------------------------
func main() {
// ?
}
================================================
FILE: 04-statements-expressions-comments/exercises/04-print-go-version/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Println(runtime.Version())
}
================================================
FILE: 04-statements-expressions-comments/exercises/05-comment-out/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
// ---------------------------------------------------------
// EXERCISE: Comment out
//
// Use single and multiline comments to comment Printlns.
//
// EXPECTED OUTPUT
// You shouldn't see any output after you're done.
// ---------------------------------------------------------
func main() {
fmt.Println("hello")
fmt.Println("how")
fmt.Println("are")
fmt.Println("you")
}
================================================
FILE: 04-statements-expressions-comments/exercises/05-comment-out/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
func main() {
// fmt.Println("hello")
/*
fmt.Println("how")
fmt.Println("are")
fmt.Println("you")
*/
}
================================================
FILE: 04-statements-expressions-comments/exercises/06-use-godoc/exercise.md
================================================
## EXERCISE
- Print the documentation of `runtime.NumCPU` function in the command line
- Print also its source code using in the command line
## HINT
You should use correct `go doc` tools
================================================
FILE: 04-statements-expressions-comments/exercises/06-use-godoc/solution/solution.md
================================================
## DOCUMENTATION:
go doc runtime NumCPU
## SOURCE CODE:
go doc -src runtime NumCPU
================================================
FILE: 04-statements-expressions-comments/exercises/README.md
================================================
1. **[Shy Semicolons](https://github.com/inancgumus/learngo/tree/master/04-statements-expressions-comments/exercises/01-shy-semicolons)**
Observe how Go fixes semicolons for you.
2. **[Naked Expression](https://github.com/inancgumus/learngo/tree/master/04-statements-expressions-comments/exercises/02-naked-expression)**
Observe what happens when you use an expression without a statement.
3. **[Operators Combine](https://github.com/inancgumus/learngo/tree/master/04-statements-expressions-comments/exercises/03-operators-combine)**
Try using operators to combine expressions.
4. **[Print Go Version](https://github.com/inancgumus/learngo/tree/master/04-statements-expressions-comments/exercises/04-print-go-version)**
Use a package from Go Standard Library to print the current version of Go on your system. Or the system which will run your program.
5. **[Comment Out](https://github.com/inancgumus/learngo/tree/master/04-statements-expressions-comments/exercises/05-comment-out)**
Learn how to comment out.
6. **[Use the GoDoc](https://github.com/inancgumus/learngo/tree/master/04-statements-expressions-comments/exercises/06-use-godoc)**
Try godoc yourself.
================================================
FILE: 04-statements-expressions-comments/questions/01-statements/README.md
================================================
## Which one is the correct description for a statement?
1. A statement instructs Go to do something *CORRECT*
2. A statement produces a value
3. A statement can't change the execution flow
> **2:** A statement can't produce a value. However, it can indirectly help to produce a value.
>
>
> **3:** It surely can.
>
>
## What's the direction of execution in a Go code?
1. From left to right
2. From top to bottom *CORRECT*
3. From right to left
4. From bottom to top
> **2:** That's right. Go executes the code from top-to-bottom, one statement at a time.
>
>
## Which one is the correct description for an expression?
1. An expression instructs Go to do something
2. An expression produces a value *CORRECT*
3. An expression can change the execution flow
> **1:** It can't. Only a statement can do that.
>
>
> **3:** It can't. Only a statement can do that.
>
>
## Which one is the correct description for an operator?
1. An operator instructs Go to do something
2. An operator can change the execution flow
3. An operator can combine expressions *CORRECT*
> **1:** It can't. Only a statement can do that.
>
>
> **2:** It can't. Only a statement can do that.
>
>
## Why doesn't the following program work?
```go
package main
import "fmt"
func main() {
"Hello"
}
```
1. "Hello" is an expression and it can't be on its own on a single line of code without a statement. *CORRECT*
2. By removing the double-quotes surrounding the "Hello". Like this: Hello
3. By moving "Hello" out of the func main.
## Does the following program work?
```go
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Println(runtime.NumCPU()); fmt.Println("cpus"); fmt.Println("the machine")
}
```
1. It works: Expressions can be typed by separating them using semicolons
2. It doesn't work: Statements should be on their own on a single line of code
3. It works: Go adds semicolons behind the scenes for every statement already *CORRECT*
> **1:** It works but that's not the reason. And, expressions can't be typed like that.
>
>
> **2:** Are you sure?
>
>
> **3:** That's right. Whether there's a semicolon or not; Go adds them automatically. Those statements are still assumed as they're on a different code line of their own.
>
>
## Why does this program work?
```go
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Println(runtime.NumCPU() + 10)
}
```
1. Operators can combine expressions *CORRECT*
2. Statements can be used with operators
3. Expressions can return multiple values
> **1:** That's right. + operator combines `runtime.NumCPU()` and `10` expressions.
>
>
> **2:** No, they can't be. For example, you can't do this: `import "fmt" + 3`. Some statement can allow expressions. However, this doesn't mean that they can be combined using expressions.
>
>
> **3:** That's right however it's irrelevant to why this code works.
>
>
================================================
FILE: 04-statements-expressions-comments/questions/02-expressions/README.md
================================================
## Please check out the questions inside the statements directory.
================================================
FILE: 04-statements-expressions-comments/questions/03-comments/README.md
================================================
## Why do you need to use comments sometimes?
1. To combine different expressions together
2. To provide explanations or generating automatic documentation for your code *CORRECT*
3. To make the code look nice and beautiful
## Which of the following code is correct?
1.
```go
package main
/ main function is an entry point /
func main() {
fmt.Println("Hi")
}
```
2. *CORRECT*
```go
package main
// main function is an entry point /*
func main() {
fmt.Println(/* this will print Hi! */ "Hi")
}
```
3.
```go
package main
/*
main function is an entry point
It allows Go to find where to start executing an executable program.
*/
func main() {
fmt.Println(// "this will print Hi!")
}
```
> **1:** `/` is not a comment. It should be `//`.
>
>
> **2:** Multiline comments can be put almost anywhere. However, when a comment starts with `/*`, it also needs to end with `*/`. Here, Go doesn't interpret `/* ... */`, it just skips it. And, when Go sees `//` as the first two characters in a code, it skips the whole line.
>
>
> **3:** `//` prevents Go to interpret the rest of the code line. That's why this code doesn't work. Go can't interpret this part because of the comment: `"this will print Hi!")`
>
>
## How should you name your code so that Go can generate documentation from your code automatically?
1. By commenting each line of the code; then it will generate the documentation from whatever it sees
2. By starting the comments using the name of the declared names *CORRECT*
3. By using multi-line comments
> **1:** This won't help. Sorry.
>
>
> **3:** It doesn't matter whether you type your comments using single-line comments or multi-line comments.
>
>
## Which tool do you need to use from the command-line to print the documentation?
1. go build
2. go run
3. go doctor
4. go doc *CORRECT*
## What's the difference between `godoc` and `go doc`?
1. `go doc` is the real tool behind `godoc`
2. `godoc` is the real tool behind `go doc` *CORRECT*
3. `go` tool is the real tool behind `go doc`
4. `go` tool is the real tool behind `godoc`
> **2:** That's right. go doc tool uses godoc tool behind the scenes. go doc is just a simplified version of the godoc tool.
>
>
================================================
FILE: 05-write-your-first-library-package/exercise/README.md
================================================
[Check out the exercise and its solution here.](https://github.com/inancgumus/learngo/tree/master/05-write-your-first-library-package/exercise)
---
# EXERCISE
1. Create a new library
2. In it, create a function that returns the Go version
3. Create a command and import your library
4. Call your function that returns Go version
5. Run your program
## HINTS
**Create your package function like this:**
```go
func Version() string {
return runtime.Version()
}
```
## EXPECTED OUTPUT
It should print the current Go version on your system.
## WARNING
You should create this package under your own folder, not in github.com/inancgumus/learngo folder. Also, please note that VS Code may automatically import my library which is in github.com/inancgumus/learngo instead of your own library.
So, if you want VS Code automatically import your own package when you save, just move github.com/inancgumus/learngo out of GOPATH to somewhere else, for example, to your Desktop (of course move it back afterward).
See [this question](https://www.udemy.com/learn-go-the-complete-bootcamp-course-golang/learn/v4/questions/5518190) in Q&A for more information.
================================================
FILE: 05-write-your-first-library-package/exercise/solution/golang/cmd/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt" // You should replace this with your username
"github.com/inancgumus/learngo/05-write-your-first-library-package/exercise/solution/golang"
)
func main() {
fmt.Println(golang.Version())
}
================================================
FILE: 05-write-your-first-library-package/exercise/solution/golang/go.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package golang
import (
"runtime"
)
// Version returns the current Go version
func Version() string {
return runtime.Version()
}
================================================
FILE: 05-write-your-first-library-package/printer/cmd/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// Automatically imports!... AWESOME!
import "github.com/inancgumus/learngo/05-write-your-first-library-package/printer"
func main() {
printer.Hello()
}
================================================
FILE: 05-write-your-first-library-package/printer/printer.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package printer
import "fmt"
// Hello is an exported function
func Hello() {
fmt.Println("exported hello")
}
================================================
FILE: 05-write-your-first-library-package/questions/README.md
================================================
## Which one below is correct?
**NOTE** _There are explanations inside the answers. Even if you know the answer please try to select all of them one by one, so you can read the explanations._
1. You can run a library package.
2. In a library package, there should be a function named main (func main).
3. You can compile a library package. *CORRECT*
4. You have to compile a library package.
> **1:** You can't, but you can import it from other packages.
>
> **2:** In a library package, you don't have to include the main function. Because it isn't an executable package. Only in executable packages you need a main func.
>
> **4:** You don't have to compile it. When you import it, it will automatically be built by the other program or library when it gets compiled or ran.
## What do you need to export a name?
1. You need to type it in all capital letters
2. You need to type its first letter as a capital letter *CORRECT*
3. You need to put it inside a function scope
4. You need to create a new file for that name
> **1:** When you do so, it will be exported, that's true, but don't do that; so I assume that this answer is not correct :)
>
> **2:** That's right. Then the other packages can access it.
>
> **3:** It should be in a package scope, not function scope.
>
> **4:** You don't have to do that.
## How can you use a function from your library from an executable program?
1. You need to export your library package first; then you can access its imported names
2. You need to import your library package first; then you can access its exported names *CORRECT*
3. You can access your library package as if it's in your executable program
4. You can import it just by using its name
> **1:** You can't export packages. All packages are already exported. Unless you put them in a directory called: "internal". But, that's an advanced topic for now.
>
> **2:** That's right.
>
> **3:** You can't access a package from another package without importing it.
>
> **4:** No, you can't. You need to import it using its full directory path after GOPATH. BTW, in the near future, this may change with the Go modules support.
## In the following program, which names are exported?
```go
package wizard
import "fmt"
func doMagic() {
fmt.Println("enchanted!")
}
func Fireball() {
fmt.Println("fireball!!!")
}
```
1. fmt
2. doMagic
3. Fireball *CORRECT*
4. Println
> **1:** That's just an imported package name.
>
> **2:** It starts with a lowercase letter; so, it's not exported.
>
> **3:** That's right. It starts with a capital letter.
>
> **4:** This isn't your function. It's already been exported in the fmt package. But, it isn't exported here.
## In the following program, which names are exported?
```go
package wizard
import "fmt"
var one string
var Two string
var greenTrees string
func doMagic() {
fmt.Println("enchanted!")
}
func Fireball() {
fmt.Println("fireball!!!")
}
```
1. doMagic and Fireball
2. Fireball and Two *CORRECT*
3. Fireball, greenTrees and Two
4. Fireball, greenTrees, one and Two
> **1:** doMagic starts with a lowercase letter; so, it's not exported.
>
> **2:** That's right. Fireball and Two, they both start with a capital letter.
>
> **3:** greenTrees starts with a lowercase letter; so, it's not exported.
>
> **4:** one and greenTrees do not start with capital letters; so, they're not exported.
================================================
FILE: 06-variables/01-basic-data-types/exercises/01-print-the-literals/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Print the literals
//
// 1. Print a few integer literals
//
// 2. Print a few float literals
//
// 3. Print true and false bool constants
//
// 4. Print your name using a string literal
//
// 5. Print a non-english sentence using a string literal
//
// ---------------------------------------------------------
func main() {
// Use fmt.Println()
}
================================================
FILE: 06-variables/01-basic-data-types/exercises/01-print-the-literals/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
fmt.Println(42, 8500, 344433, -2323)
fmt.Println(3.14, 6.28, -42.)
fmt.Println(true, false)
fmt.Println("Hi! I'm Inanc!")
fmt.Println("Merhaba, adım İnanç!")
}
================================================
FILE: 06-variables/01-basic-data-types/exercises/02-print-hexes/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
// THIS EXERCISE IS OPTIONAL
// ---------------------------------------------------------
// EXERCISE: Print hexes
//
// 1. Print 0 to 9 in hexadecimal
//
// 2. Print 10 to 15 in hexadecimal
//
// 3. Print 17 in hexadecimal
//
// 4. Print 25 in hexadecimal
//
// 5. Print 50 in hexadecimal
//
// 6. Print 100 in hexadecimal
//
// EXPECTED OUTPUT
// 0 1 2 3 4 5 6 7 8 9
// 10 11 12 13 14 15
// 17
// 25
// 50
// 100
//
// NOTES
// https://stackoverflow.com/questions/910309/how-to-turn-hexadecimal-into-decimal-using-brain
//
// https://simple.wikipedia.org/wiki/Hexadecimal_numeral_system
//
// ---------------------------------------------------------
func main() {
// EXAMPLES:
// I'm going to print 10 in hexadecimal
fmt.Println(0xa)
// I'm going to print 16 in hexadecimal
// 0x10
// ^^----- 1 * 0 = 0
// |
// +------ 16 * 1 = 16
// = 16
fmt.Println(0x10)
// I'm going to print 150 in hexadecimal
// 0x96
// ^^----- 1 * 6 = 6
// |
// +------ 16 * 9 = 144
// = 150
fmt.Println(0x96)
// COMMENT-OUT ALL THE CODE ABOVE, THEN,
// ADD YOUR OWN SOLUTIONS BELOW
}
================================================
FILE: 06-variables/01-basic-data-types/exercises/02-print-hexes/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
fmt.Println(0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9)
fmt.Println(0xa, 0xb, 0xc, 0xd, 0xe, 0xf)
fmt.Println(0x11) // 17
fmt.Println(0x19) // 25
fmt.Println(0x32) // 50
fmt.Println(0x64) // 100
}
================================================
FILE: 06-variables/01-basic-data-types/exercises/README.md
================================================
1. **[Print the literals](https://github.com/inancgumus/learngo/tree/master/06-variables/01-basic-data-types/exercises/01-print-the-literals)**
Print a few values using the literals
2. **[Print hexes](https://github.com/inancgumus/learngo/tree/master/06-variables/01-basic-data-types/exercises/02-print-hexes)** (optional exercise)
Print numbers in hexadecimal
================================================
FILE: 06-variables/01-basic-data-types/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// integer literal
fmt.Println(
-200, -100, 0, 50, 100, 100,
)
// float literal
fmt.Println(
-50.5, -20.5, -0., 1., 100.56, // ...
)
// bool constants
fmt.Println(
true, false,
)
// string literal - utf-8
fmt.Println(
"", // empty - prints just a space
"hi",
// unicode
"nasılsın?", // "how are you" in turkish
"hi there 星!", // "hi there star!"
)
}
================================================
FILE: 06-variables/01-basic-data-types/questions/README.md
================================================
## Which one below is an integer literal?
* -42 *CORRECT*
* This is an integer literal
* "Hello"
* This is a string literal
* false
* This is a bool constant
* 3.14
* This is a float literal
## Which one below is a float literal?
* -42
* "Hello"
* false
* 3.14 *CORRECT*
## Which one below is a float literal?
* 6,28
* ,28
* .28 *CORRECT*
* 628
## Which one below is a string literal?
* -42
* "Hello" *CORRECT*
* false
* 3.14
## Which one below is a bool constant?
* -42
* "Hello"
* false *CORRECT*
* 3.14
================================================
FILE: 06-variables/02-declarations/01-declaration-syntax/01-syntax/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var speed int
fmt.Println(speed)
}
================================================
FILE: 06-variables/02-declarations/01-declaration-syntax/02-naming-rules/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// VARIABLE NAMING RULES
func main() {
// CORRECT DECLARATIONS
var speed int
var SpeeD int
// underscore is allowed but not recommended
var _speed int
// Unicode letters are allowed
var 速度 int
// keep the compiler happy
_, _, _, _ = speed, SpeeD, _speed, 速度
}
================================================
FILE: 06-variables/02-declarations/01-declaration-syntax/03-order-of-declaration/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
func main() {
// fmt.Println(speed)
// var speed int
}
================================================
FILE: 06-variables/02-declarations/02-example-declarations/01-int/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var nFiles int
var counter int
var nCPU int
fmt.Println(
nFiles,
counter,
nCPU,
)
}
================================================
FILE: 06-variables/02-declarations/02-example-declarations/02-float64/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var heat float64
var ratio float64
var degree float64
fmt.Println(
heat,
ratio,
degree,
)
}
================================================
FILE: 06-variables/02-declarations/02-example-declarations/03-bool/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var off bool
var valid bool
var closed bool
fmt.Println(
off,
valid,
closed,
)
}
================================================
FILE: 06-variables/02-declarations/02-example-declarations/04-string/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var msg string
var name string
var text string
fmt.Println(
msg,
name,
text,
)
}
================================================
FILE: 06-variables/02-declarations/03-zero-values/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
// EXERCISE: Let's run this to see the zero-values yourself
func main() {
var speed int // numeric type
var heat float64 // numeric type
var off bool
var brand string
fmt.Println(speed)
fmt.Println(heat)
fmt.Println(off)
// I've used printf to print an empty string
// EXERCISE: Use Println to see what happens
fmt.Printf("%q\n", brand)
}
================================================
FILE: 06-variables/02-declarations/04-unused-variables-and-blank-identifier/01-unused-variable/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// there's no warning for package-level vars
var packageLevelVar string
func main() {
// unused variable error
// var speed int
// if you use it, the error will be gone
// fmt.Println(speed)
}
================================================
FILE: 06-variables/02-declarations/04-unused-variables-and-blank-identifier/02-blank-identifier/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
func main() {
var speed int
// let's assign the variable to the blank-identifier
// so that Go compiler won't get grumpy
_ = speed
}
================================================
FILE: 06-variables/02-declarations/05-multiple-declarations/01-multiple/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var (
speed int
heat float64
off bool
brand string
)
fmt.Println(speed)
fmt.Println(heat)
fmt.Println(off)
fmt.Printf("%q\n", brand)
}
================================================
FILE: 06-variables/02-declarations/05-multiple-declarations/02-parallel/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// this is equal to:
//
// var (
// speed int
// velocity int
// )
//
// or:
//
// var speed int
// var velocity int
//
var speed, velocity int
fmt.Println(speed, velocity)
}
================================================
FILE: 06-variables/02-declarations/06-examples/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// names are case-sensitive:
// MyAge, myAge, and MYAGE are different variables
// USE-CASE:
// When to use a parallel declaration?
//
// NOT GOOD:
// var myAge int
// var yourAge int
//
// SO-SO:
// var (
// myAge int
// yourAge int
// )
//
// BETTER:
var myAge, yourAge int
fmt.Println(myAge, yourAge)
var temperature float64
fmt.Println(temperature)
var success bool
fmt.Println(success)
var language string
fmt.Println(language)
}
================================================
FILE: 06-variables/02-declarations/exercises/01-int/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Declare int
//
// 1. Declare and print a variable with an int type
//
// 2. The declared variable's name should be: height
//
// EXPECTED OUTPUT
// 0
// ---------------------------------------------------------
func main() {
// var ? ?
// ?
}
================================================
FILE: 06-variables/02-declarations/exercises/01-int/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
var height int
fmt.Println(height)
}
================================================
FILE: 06-variables/02-declarations/exercises/02-bool/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Declare bool
//
// 1. Declare and print a bool variable
//
// 2. The variable's name should be: isOn
//
// EXPECTED OUTPUT
// false
// ---------------------------------------------------------
func main() {
// var ? ?
// ?
}
================================================
FILE: 06-variables/02-declarations/exercises/02-bool/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
var isOn bool
fmt.Println(isOn)
}
================================================
FILE: 06-variables/02-declarations/exercises/03-float64/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Declare float64
//
// 1. Declare and print a variable with a float64 type
//
// 2. The declared variable's name should be: brightness
//
// EXPECTED OUTPUT
// 0
// ---------------------------------------------------------
func main() {
// var ? ?
// ?
}
================================================
FILE: 06-variables/02-declarations/exercises/03-float64/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
var brightness float64
fmt.Println(brightness)
}
================================================
FILE: 06-variables/02-declarations/exercises/04-string/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Declare string
//
// 1. Declare a string variable
//
// 2. Print that variable
//
// EXPECTED OUTPUT
// ""
// ---------------------------------------------------------
func main() {
// USE THE BELOW CODE
// You'll learn about Printf later
// var ?
// fmt.Printf("s (%T): %q\n", s, s)
// %T prints the type of the value
// %q prints an empty string
}
================================================
FILE: 06-variables/02-declarations/exercises/04-string/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var s string
fmt.Printf("s (%T): %q\n", s, s)
}
================================================
FILE: 06-variables/02-declarations/exercises/05-undeclarables/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Undeclarables
//
// 1. Declare the variables below:
// 3speed
// !speed
// spe?ed
// var
// func
// package
//
// 2. Observe the error messages
//
// NOTE
// The types of the variables are not important.
// ---------------------------------------------------------
func main() {
// var ? int
// var ? int
// var ? int
// var ? int
// var ? int
// var ? int
}
================================================
FILE: 06-variables/02-declarations/exercises/05-undeclarables/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
func main() {
// var 3speed int
// var !speed int
// var spe?ed int
// var var int
// var func int
// var package int
}
================================================
FILE: 06-variables/02-declarations/exercises/06-with-bits/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Declare with bits
//
// 1. Declare a few variables using the following types
// int
// int8
// int16
// int32
// int64
// float32
// float64
// complex64
// complex128
// bool
// string
// rune
// byte
//
// 2. Observe their output
//
// 3. After you've done, check out the solution
// and read the comments there
//
// EXPECTED OUTPUT
// 0 0 0 0 0 0 0 (0+0i) (0+0i) false 0 0
// ""
// ---------------------------------------------------------
func main() {
// var i int
// var i8 int8
// CONTINUE FROM HERE....
}
================================================
FILE: 06-variables/02-declarations/exercises/06-with-bits/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// integer types
var i int
var i8 int8
var i16 int16
var i32 int32
var i64 int64
// float types
var f32 float32
var f64 float64
// complex types
var c64 complex64
var c128 complex128
// bool type
var b bool
// string types
var s string
var r rune // also a numeric type
var by byte // also a numeric type
fmt.Println(
i, i8, i16, i32, i64,
f32, f64,
c64, c128,
b, r, by,
)
// You could do it with Println as well
fmt.Printf("%q\n", s)
}
================================================
FILE: 06-variables/02-declarations/exercises/07-multiple/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Multiple
//
// 1. Declare two variables using
// multiple variable declaration statement
//
// 2. The first variable's name should be active
// 3. The second variable's name should be delta
//
// 4. Print them all
//
// HINT
// You should declare a bool and an int variable
//
// EXPECTED OUTPUT
// false 0
// ---------------------------------------------------------
func main() {
// var (
// ?
// )
// fmt.Println(active, delta)
}
================================================
FILE: 06-variables/02-declarations/exercises/07-multiple/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var (
active bool
delta int
)
fmt.Println(active, delta)
}
================================================
FILE: 06-variables/02-declarations/exercises/08-multiple-2/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Multiple #2
//
// 1. Declare and initialize two string variables
// using multiple variable declaration
//
// 2. Use the type once while declaring the variables
//
// 3. The first variable's name should be firstName
// 4. The second variable's name should be lastName
//
// 5. Print them all
//
// EXPECTED OUTPUT
// "" ""
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATION HERE
//
// REPLACE THE QUESTION-MARKS BELOW
// WITH THE NAME OF YOUR VARIABLES
// fmt.Printf("%q %q\n", ?, ?)
}
================================================
FILE: 06-variables/02-declarations/exercises/08-multiple-2/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var firstName, lastName string = "", ""
fmt.Printf("%q %q\n", firstName, lastName)
}
================================================
FILE: 06-variables/02-declarations/exercises/09-unused/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Unused
//
// 1. Declare a variable
//
// 2. Variable's name should be: isLiquid
//
// 3. Discard it using a blank-identifier
//
// NOTE
// Do not print the variable
// ---------------------------------------------------------
func main() {
}
================================================
FILE: 06-variables/02-declarations/exercises/09-unused/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
func main() {
var isLiquid bool
_ = isLiquid
}
================================================
FILE: 06-variables/02-declarations/exercises/10-package-variable/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Package Variable
//
// 1. Declare a variable in the package-scope
//
// 2. Observe whether something happens when you don't
// use it
// ---------------------------------------------------------
func main() {
}
================================================
FILE: 06-variables/02-declarations/exercises/10-package-variable/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
var isLiquid bool
func main() {
}
================================================
FILE: 06-variables/02-declarations/exercises/11-wrong-doer/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Wrong doer
//
// 1. Print a variable
//
// 2. Then declare it
// (This means: Try to print it before its declaration)
//
// 3. Observe the error
// ---------------------------------------------------------
func main() {
// First print it:
// fmt.Println(?)
// Then declare it:
// var ? ?
}
================================================
FILE: 06-variables/02-declarations/exercises/11-wrong-doer/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
func main() {
// UNCOMMENT THE CODE BELOW TO SEE THE ERROR
// fmt.Println(age)
// var age int
}
================================================
FILE: 06-variables/02-declarations/exercises/README.md
================================================
# Declare and Print Variables
Warm up. Declare a few variables and get some experience. Get used to the variable declaration syntax.
1. **[Declare int](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/01-int)**
2. **[Declare bool](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/02-bool)**
3. **[Declare float64](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/03-float64)**
4. **[Declare string](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/04-string)**
5. **[Declare undeclarables](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/05-undeclarables)**
6. **[Declare with bits](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/06-with-bits)**
7. **[Declare multiple](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/07-multiple)**
8. **[Declare multiple 2](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/08-multiple-2)**
9. **[Declare an unused variable](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/09-unused)**
10. **[Declare a package variable](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/10-package-variable)**
11. **[Use before declare](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/11-wrong-doer)**
================================================
FILE: 06-variables/02-declarations/questions/01-what/README.md
================================================
# QUESTIONS: What's a variable?
## Where does a variable live?
* Hard Disk
* Computer Memory - *CORRECT*
* CPU
## What do you use a variable's name for?
* To be able to access it later - *CORRECT*
* It's just a label
* I don't need to use it
## How to change the value of a variable?
* By using its name - *CORRECT*
* By using its value
* By asking to Go
## After its declaration can you change the variable's type?
* Yes : Go is dynamically-typed
* No : Go is statically-typed - *CORRECT*
* Both: Go supports both of them
================================================
FILE: 06-variables/02-declarations/questions/02-declaration/README.md
================================================
## Which statement do you need to use for declaring variables?
* name int
* vars string name
* var name integer
* var width int *CORRECT*
## Which sentence below is correct?
* You can use a variable before declaring it
* You have to declare a variable before using it *CORRECT*
## What kind of language is Go?
* Weakly-Typed
* Dynamically-Typed
* Strongly-Typed *CORRECT*
* Freely-Typed
## Which variable name below is correct?
* int
* four *CORRECT*
* 2computers
* one?there
================================================
FILE: 06-variables/02-declarations/questions/03-unused-variables/README.md
================================================
## What happens when you don't use a declared variable in the block scope?
* Nothing, it will work fine
* It will get removed automatically
* The program won't compile *CORRECT*
## What happens when you don't use a declared variable in the package scope?
* Nothing, it will work fine *CORRECT*
* It will get removed automatically
* The program won't compile
## How can you prevent unused variable error?
* You can change the variable's name
* You can use a blank-identifier to discard it *CORRECT*
* You can change the variable's type
================================================
FILE: 06-variables/02-declarations/questions/04-zero-values/README.md
================================================
## Which type's zero value is 0?
- bool
- pointer
- string
- all numeric types *CORRECT*
## Which type's zero value is false?
- bool *CORRECT*
- pointer
- string
- all numeric types
## Which type's zero value is ""?
- bool
- pointer
- string *CORRECT*
- all numeric types
## Which type's zero value is nil?
- bool
- pointer *CORRECT*
- string
- all numeric types
================================================
FILE: 06-variables/03-short-declaration/01-initialization-and-short-declaration/01-initialization/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// = is the assignment operator
// when used within a variable declaration, it
// initializes the variable to the given value
// here, Go initializes the safe variable to true
// OPTION #1 (option #2 is better)
// var safe bool = true
// OPTION #2
var safe = true
fmt.Println(safe)
}
================================================
FILE: 06-variables/03-short-declaration/01-initialization-and-short-declaration/02-short-declaration/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// OPTION #1 (option #2 is better)
// var safe bool = true
// OPTION #2 (OK)
// var safe = true
// OPTION #3 - SHORT DECLARATION (BEST)
//
// You don't even need to type the `var` keyword
//
// Short declaration equals to:
// var safe bool = true
// var safe = true
//
// Go gets (infers) the type from the initializer value
//
// true's default type is bool
// so, the type of the safe variable becomes a bool
safe := true
fmt.Println(safe)
}
================================================
FILE: 06-variables/03-short-declaration/01-initialization-and-short-declaration/03-coding-example/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// var name string = "Carl"
// var name = "Carl"
name := "Carl"
// var isScientist bool = true
// var isScientist = true
isScientist := true
// var age int = 62
// var age = 62
age := 62
// var degree float64 = 5.
// var degree = 5.
degree := 5.
fmt.Println(name, isScientist, age, degree)
// type inference also works for variables
//
// Go gets the type of the variable and assigns it
// to the newly declared variable
//
// The type of the name2 variable is `string` now
name2 := name
fmt.Println(name2)
}
================================================
FILE: 06-variables/03-short-declaration/02-package-scope/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
// You can't use declaration statements without a keyword
// Short declaration doesn't have a keyword (`var`)
// So, it can't be used at the package scope
//
// SYNTAX ERROR:
// "non-declaration statement outside function body"
// safe := true
// However, you can use the normal declaration at the
// package scope. Since it has a keyword: `var`
var safe = true
func main() {
fmt.Println(safe)
}
================================================
FILE: 06-variables/03-short-declaration/03-multiple-short-declaration/01-declaration/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// the number of variables and values should be equal
// -> `true` is being assigned to `safe`
// -> `50` is being assigned to `speed`
safe, speed := true, 50
fmt.Println(safe, speed)
}
================================================
FILE: 06-variables/03-short-declaration/03-multiple-short-declaration/02-coding-example/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
name, lastname := "Nikola", "Tesla"
fmt.Println(name, lastname)
birth, death := 1856, 1943
fmt.Println(birth, death)
on, off := true, false
fmt.Println(on, off)
// there's no limit
// however, more declarations that you declare
// more unreadable it becomes...
degree, ratio, heat := 10.55, 30.5, 20.
fmt.Println(degree, ratio, heat)
// you can short declare variables with different types
nFiles, valid, msg := 10, true, "hello"
fmt.Println(nFiles, valid, msg)
}
================================================
FILE: 06-variables/03-short-declaration/03-multiple-short-declaration/03-redeclaration/01/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// `safe`'s value is `false`
var safe bool
// `safe`'s value is now `true`
// `speed` is declared and initialized to `50`
// redeclaration only works when
//
// at least one of the variables
// should be a new variable
safe, speed := true, 50
fmt.Println(safe, speed)
// EXERCISE
//
// Declare the speed variable before
// the short declaration "again"
//
// Observe what happens
}
================================================
FILE: 06-variables/03-short-declaration/03-multiple-short-declaration/03-redeclaration/02-coding-example/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// EXAMPLE #1
name := "Nikola"
fmt.Println(name)
// name already exists in this block
// name := "Marie"
// just assigns new values to name
// and declares the new variable age with a value of 66
name, age := "Marie", 66
fmt.Println(name, age)
// EXAMPLE #2
// name = "Albert"
// birth := 1879
// redeclaration below equals to the statements just above
//
// `name` is an existing variable
// Go just assigns "Albert" to the name variable
//
// `birth` is a new variable
// Go declares it and assigns it a value of `1879`
name, birth := "Albert", 1879
fmt.Println(name, birth)
}
================================================
FILE: 06-variables/03-short-declaration/04-short-vs-normal/01-declaration/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// normal declaration use cases
// -----------------------------------------------------
// when you need a package scoped variable
// -----------------------------------------------------
// version := 0 // YOU CAN'T
var version int
func main() {
// -----------------------------------------------------
// if you don't know the initial value
// -----------------------------------------------------
// DON'T DO THIS:
// score := 0
// DO THIS:
// var score int
// -----------------------------------------------------
// group variables for readability
// -----------------------------------------------------
// var (
// video string
// duration int
// current int
// )
}
================================================
FILE: 06-variables/03-short-declaration/04-short-vs-normal/02-short-declaration/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// short declaration use cases
func main() {
// -----------------------------------------------------
// if you know the initial value
// -----------------------------------------------------
// DON'T DO THIS:
// var width, height = 100, 50
// DO THIS (concise):
// width, height := 100, 50
// -----------------------------------------------------
// redeclaration
// -----------------------------------------------------
// DON'T DO THIS:
// width = 50
// color := red
// DO THIS (concise):
// width, color := 50, "red"
}
================================================
FILE: 06-variables/03-short-declaration/exercises/01-short-declare/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Short Declare
//
// Declare and then print four variables using
// the short declaration statement.
//
// EXPECTED OUTPUT
// i: 314 f: 3.14 s: Hello b: true
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATIONS HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(
// "i:", i,
// "f:", f,
// "s:", s,
// "b:", b,
// )
}
================================================
FILE: 06-variables/03-short-declaration/exercises/01-short-declare/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
i := 314
f := 3.14
s := "Hello"
b := true
fmt.Println(
"i:", i,
"f:", f,
"s:", s,
"b:", b,
)
}
================================================
FILE: 06-variables/03-short-declaration/exercises/02-multiple-short-declare/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Multiple Short Declare
//
// Declare two variables using multiple short declaration
//
// EXPECTED OUTPUT
// 14 true
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATIONS HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(a, b)
}
================================================
FILE: 06-variables/03-short-declaration/exercises/02-multiple-short-declare/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
a, b := 14, true
fmt.Println(a, b)
}
================================================
FILE: 06-variables/03-short-declaration/exercises/03-multiple-short-declare-2/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Multiple Short Declare #2
//
// 1. Declare two variables using multiple short declaration
//
// 2. `a` variable's value should be 42
// 3. `c` variable's value should be "good"
//
// EXPECTED OUTPUT
// 42 good
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATIONS HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(a, c)
}
================================================
FILE: 06-variables/03-short-declaration/exercises/03-multiple-short-declare-2/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
a, c := 42, "good"
fmt.Println(a, c)
}
================================================
FILE: 06-variables/03-short-declaration/exercises/04-short-with-expression/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Short With Expression
//
// 1. Short declare a variable named `sum`
//
// 2. Initialize it with an expression by adding 27 and 3.5
//
// EXPECTED OUTPUT
// 30.5
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATION HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(sum)
}
================================================
FILE: 06-variables/03-short-declaration/exercises/04-short-with-expression/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
sum := 27 + 3.5
fmt.Println(sum)
}
================================================
FILE: 06-variables/03-short-declaration/exercises/05-short-discard/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Short Discard
//
// 1. Short declare two bool variables
// (use multiple short declaration syntax)
//
// 2. Initialize both variables to true
//
// 3. Change your declaration and
// discard the 2nd variable's value
// using the blank-identifier
//
// 4. Print only the 1st variable
//
// EXPECTED OUTPUT
// true
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATIONS HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(on)
}
================================================
FILE: 06-variables/03-short-declaration/exercises/05-short-discard/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
// You can discard values in a short declaration
on, _ := true, true
fmt.Println(on)
}
================================================
FILE: 06-variables/03-short-declaration/exercises/06-redeclare/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Redeclare
//
// 1. Short declare two int variables: age and yourAge
// (use multiple short declaration syntax)
//
// 2. Short declare a new float variable: ratio
// And, change the 'age' variable to 42
//
// (! You should use redeclaration)
//
// 4. Print all the variables
//
// EXPECTED OUTPUT
// 42, 20, 3.14
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATIONS HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(age, yourAge, ratio)
}
================================================
FILE: 06-variables/03-short-declaration/exercises/06-redeclare/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
age, yourAge := 10, 20
age, ratio := 42, 3.14
fmt.Println(age, yourAge, ratio)
}
================================================
FILE: 06-variables/03-short-declaration/exercises/README.md
================================================
# Short Declare
Time to declare a few variables using the short declaration syntax. You'll also use the redeclaration and discarding.
1. **[Short Declare](https://github.com/inancgumus/learngo/tree/master/06-variables/03-short-declaration/exercises/01-short-declare)**
2. **[Multiple Short Declare](https://github.com/inancgumus/learngo/tree/master/06-variables/03-short-declaration/exercises/02-multiple-short-declare)**
3. **[Multiple Short Declare #2](https://github.com/inancgumus/learngo/tree/master/06-variables/03-short-declaration/exercises/03-multiple-short-declare-2)**
4. **[Short With Expression](https://github.com/inancgumus/learngo/tree/master/06-variables/03-short-declaration/exercises/04-short-with-expression)**
5. **[Short Discard](https://github.com/inancgumus/learngo/tree/master/06-variables/03-short-declaration/exercises/05-short-discard)**
6. **[Redeclare](https://github.com/inancgumus/learngo/tree/master/06-variables/03-short-declaration/exercises/06-redeclare)**
================================================
FILE: 06-variables/03-short-declaration/questions/README.md
================================================
## Which is a correct declaration?
* var int safe := 3
* var safe bool := 3
* safe := true *CORRECT*
## Which is a correct declaration?
* var short := true
* int num := 1
* speed := 50 *CORRECT*
* num int := 2
## Which is a correct declaration?
* x, y, z := 10, 20
* x = 10,
* y, x, p := 5, "hi", 1.5 *CORRECT*
* y, x = "hello", 10
## Which declaration is equal to the following declaration?
```go
var s string = "hi"
```
* var s int = "hi"
* s := "hi" *CORRECT*
* s, p := 2, 3
## Which declaration is equal to the following declaration?
```go
var n = 10
```
* n := 10.0
* m, n := 1, 0
* var n int = 10 *CORRECT*
## What's the type of the `s` variable?
```go
s := "hmm..."
```
* bool
* string *CORRECT*
* int
* float64
## What's the type of the `b` variable?
```go
b := true
```
* bool *CORRECT*
* string
* int
* float64
## What's the type of the `i` variable?
```go
i := 42
```
* bool
* string
* int *CORRECT*
* float64
## What's the type of the `f` variable?
```go
f := 6.28
```
* bool
* string
* int
* float64 *CORRECT*
## What's the value of the `x` variable?
```go
y, x := false, 20
```
* 10
* 20 *CORRECT*
* false
## What's the value of the `x` variable?
```go
y, x := false, 20
x, z := 10, "hi"
```
* 10 *CORRECT*
* 20
* false
## Which of the following declaration can be used in the package scope?
* x := 10
* y, x := 10, 5
* var x, y = 5, 10 *CORRECT*
================================================
FILE: 06-variables/04-assignment/01-assignment/01-assignment/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var speed int
fmt.Println(speed)
speed = 100
fmt.Println(speed)
speed = speed - 25
fmt.Println(speed)
}
================================================
FILE: 06-variables/04-assignment/01-assignment/02-strongly-typed/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// Go is a strongly typed programming language.
// Even a float and an integer are different types.
// Or: int32 and int are different types.
// EXERCISE: Try uncommenting the lines
// And observe the errors
func main() {
var speed int
// speed = "100"
var running bool
// running = 1
var force float64
// speed = force
// Go automatically converts the typeless
// integer literal to float64 automatically
force = 1
// keep the compiler happy
_, _, _ = speed, running, force
}
================================================
FILE: 06-variables/04-assignment/01-assignment/03-examples/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var (
name string
age int
famous bool
)
// Example #1
name = "Newton"
age = 84
famous = true
fmt.Println(name, age, famous)
// Example #2
name = "Somebody"
age = 20
famous = false
fmt.Println(name, age, famous)
// Example #3
// EXERCISE: Why this doesn't work? Think about it.
// name = 20
// name = age
// save the previous value of the variable
// to a new variable
var prevName string
prevName = name
// overwrite the value of the original variable
// by assigning to it
name = "Einstein"
fmt.Println("previous name:", prevName)
fmt.Println("current name :", name)
}
================================================
FILE: 06-variables/04-assignment/01-overview/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var counter int
fmt.Println("counter's name : counter")
fmt.Println("counter's value:", counter)
fmt.Printf("counter's type : %T\n", counter)
counter = 10 // OK
// counter = "ten" // NOT OK
fmt.Println("counter's value:", counter)
counter++
fmt.Println("counter's value:", counter)
}
================================================
FILE: 06-variables/04-assignment/05-multiple-assignment/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"time"
)
func main() {
var (
speed int
now time.Time
)
speed, now = 100, time.Now()
fmt.Println(speed, now)
// EXERCISE:
// Try this alternative (formatted time).
// fmt.Println(speed, now.Format(time.Kitchen))
}
================================================
FILE: 06-variables/04-assignment/06-swapping/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var (
speed = 100
prevSpeed = 50
)
speed, prevSpeed = prevSpeed, speed
fmt.Println(speed, prevSpeed)
}
================================================
FILE: 06-variables/04-assignment/07-path-project/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"path"
)
func main() {
var dir, file string
dir, file = path.Split("css/main.css")
fmt.Println("dir :", dir)
fmt.Println("file:", file)
}
================================================
FILE: 06-variables/04-assignment/08-path-project-discarding/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"path"
)
func main() {
var file string
_, file = path.Split("css/main.css")
fmt.Println("file:", file)
}
================================================
FILE: 06-variables/04-assignment/09-path-project-shortdecl/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"path"
)
func main() {
_, file := path.Split("css/main.css")
// or this:
// dir, file := path.Split("css/main.css")
fmt.Println("file:", file)
}
================================================
FILE: 06-variables/04-assignment/exercises/01-make-it-blue/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Make It Blue
//
// 1. Change `color` variable's value to "blue"
//
// 2. Print it
//
// EXPECTED OUTPUT
// blue
// ---------------------------------------------------------
func main() {
// UNCOMMENT THE CODE BELOW:
// color := "green"
// ADD YOUR CODE BELOW:
// ?
}
================================================
FILE: 06-variables/04-assignment/exercises/01-make-it-blue/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
color := "green"
color = "blue"
fmt.Println(color)
}
================================================
FILE: 06-variables/04-assignment/exercises/02-vars-to-vars/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Variables To Variables
//
// 1. Change the value of `color` variable to "dark green"
//
// 2. Do not assign "dark green" to `color` directly
//
// Instead, use the `color` variable again
// while assigning to `color`
//
// 3. Print it
//
// RESTRICTIONS
// WRONG ANSWER, DO NOT DO THIS:
// `color = "dark green"`
//
// HINT
// + operator can concatenate string values
//
// Example:
//
// "h" + "e" + "y" returns "hey"
//
// EXPECTED OUTPUT
// dark green
// ---------------------------------------------------------
func main() {
// UNCOMMENT THE CODE BELOW:
// color := "green"
// ADD YOUR CODE BELOW
// ?
// UNCOMMENT THE CODE BELOW TO PRINT THE VARIABLE
// fmt.Println(color)
}
================================================
FILE: 06-variables/04-assignment/exercises/02-vars-to-vars/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
color := "green"
// `"dark " + color` is an expression
color = "dark " + color
fmt.Println(color)
}
================================================
FILE: 06-variables/04-assignment/exercises/03-assign-with-expressions/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
// ---------------------------------------------------------
// EXERCISE: Assign With Expressions
//
// 1. Multiply 3.14 with 2 and assign it to `n` variable
//
// 2. Print the `n` variable
//
// HINT
// Example: 3 * 2 = 6
// * is the product operator (it multiplies numbers)
//
// EXPECTED OUTPUT
// 6.28
// ---------------------------------------------------------
func main() {
// DON'T TOUCH THIS
// Declares a new float64 variable
// 0. means 0.0
n := 0.
// ADD YOUR CODE BELOW
// ?
fmt.Println(n)
}
================================================
FILE: 06-variables/04-assignment/exercises/03-assign-with-expressions/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
n := 0.
n = 3.14 * 2
fmt.Println(n)
}
================================================
FILE: 06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Find the Rectangle's Perimeter
//
// 1. Find the perimeter of a rectangle
// Its width is 5
// Its height is 6
//
// 2. Assign the result to the `perimeter` variable
//
// 3. Print the `perimeter` variable
//
// HINT
// Formula = 2 times the width and height
//
// EXPECTED OUTPUT
// 22
//
// BONUS
// Find more formulas here and calculate them in new programs
// https://www.mathsisfun.com/area.html
// ---------------------------------------------------------
func main() {
// UNCOMMENT THE CODE BELOW:
// var (
// perimeter int
// width, height = 5, 6
// )
// USE THE VARIABLES ABOVE WHEN CALCULATING YOUR RESULT
// ADD YOUR CODE BELOW
}
================================================
FILE: 06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var (
perimeter int
width, height = 5, 6
)
// first calculates: (width + height)
// then : multiplies it with 2
// just like in math
perimeter = 2 * (width + height)
fmt.Println(perimeter)
}
================================================
FILE: 06-variables/04-assignment/exercises/05-multi-assign/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
// ---------------------------------------------------------
// EXERCISE: Multi Assign
//
// 1. Assign "go" to `lang` variable
// and assign 2 to `version` variable
// using a multiple assignment statement
//
// 2. Print the variables
//
// EXPECTED OUTPUT
// go version 2
// ---------------------------------------------------------
func main() {
// DO NOT TOUCH THIS
var (
lang string
version int
)
// ADD YOUR CODE BELOW
// DO NOT TOUCH THIS
fmt.Println(lang, "version", version)
}
================================================
FILE: 06-variables/04-assignment/exercises/05-multi-assign/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var (
lang string
version int
)
lang, version = "go", 2
fmt.Println(lang, "version", version)
}
================================================
FILE: 06-variables/04-assignment/exercises/06-multi-assign-2/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Multi Assign #2
//
// 1. Assign the correct values to the variables
// to match to the EXPECTED OUTPUT below
//
// 2. Print the variables
//
// HINT
// Use multiple Println calls to print each sentence.
//
// EXPECTED OUTPUT
// Air is good on Mars
// It's true
// It is 19.5 degrees
// ---------------------------------------------------------
func main() {
// UNCOMMENT THE CODE BELOW:
// var (
// planet string
// isTrue bool
// temp float64
// )
// ADD YOUR CODE BELOW
}
================================================
FILE: 06-variables/04-assignment/exercises/06-multi-assign-2/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var (
planet string
isTrue bool
temp float64
)
planet, isTrue, temp = "Mars", true, 19.5
fmt.Println("Air is good on", planet)
fmt.Println("It's", isTrue)
fmt.Println("It is", temp, "degrees")
}
================================================
FILE: 06-variables/04-assignment/exercises/07-multi-short-func/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Multi Short Func
//
// 1. Declare two variables using multiple short declaration syntax
//
// 2. Initialize the variables using `multi` function below
//
// 3. Discard the 1st variable's value in the declaration
//
// 4. Print only the 2nd variable
//
// NOTE
// You should use `multi` function
// while initializing the variables
//
// EXPECTED OUTPUT
// 4
// ---------------------------------------------------------
func main() {
// ADD YOUR DECLARATIONS HERE
//
// THEN UNCOMMENT THE CODE BELOW
// fmt.Println(b)
}
// multi is a function that returns multiple int values
func multi() (int, int) {
return 5, 4
}
================================================
FILE: 06-variables/04-assignment/exercises/07-multi-short-func/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
)
func main() {
_, b := multi()
fmt.Println(b)
}
func multi() (int, int) {
return 5, 4
}
================================================
FILE: 06-variables/04-assignment/exercises/08-swapper/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Swapper
//
// 1. Change `color` to "orange"
// and `color2` to "green" at the same time
//
// (use multiple-assignment)
//
// 2. Print the variables
//
// EXPECTED OUTPUT
// orange green
// ---------------------------------------------------------
func main() {
// UNCOMMENT THE CODE BELOW:
// color, color2 := "red", "blue"
// ?
}
================================================
FILE: 06-variables/04-assignment/exercises/08-swapper/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
color, color2 := "red", "blue"
color, color2 = "orange", "green"
fmt.Println(color, color2)
}
================================================
FILE: 06-variables/04-assignment/exercises/09-swapper-2/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Swapper #2
//
// 1. Swap the values of `red` and `blue` variables
//
// 2. Print them
//
// EXPECTED OUTPUT
// blue red
// ---------------------------------------------------------
func main() {
// UNCOMMENT THE CODE BELOW:
// red, blue := "red", "blue"
// ?
}
================================================
FILE: 06-variables/04-assignment/exercises/09-swapper-2/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
red, blue := "red", "blue"
red, blue = blue, red
fmt.Println(red, blue)
}
================================================
FILE: 06-variables/04-assignment/exercises/10-discard-the-file/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Discard The File
//
// 1. Print only the directory using `path.Split`
//
// 2. Discard the file part
//
// RESTRICTION
// Use short declaration
//
// EXPECTED OUTPUT
// secret/
// ---------------------------------------------------------
func main() {
// UNCOMMENT THE CODE BELOW:
// ? ?= path.Split("secret/file.txt")
}
================================================
FILE: 06-variables/04-assignment/exercises/10-discard-the-file/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"path"
)
func main() {
dir, _ := path.Split("secret/file.txt")
fmt.Println(dir)
}
================================================
FILE: 06-variables/04-assignment/exercises/README.md
================================================
# Assignments
Assignment means "copying" values. Everything is getting copied in Go. You'll learn more about this afterward.
Now, get your feet wet and try some assignment exercises.
1. **[Make It Blue](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/01-make-it-blue)**
2. **[Variables To Variables](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/02-vars-to-vars)**
3. **[Assign With Expressions](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/03-assign-with-expressions)**
4. **[Find the Rectangle's Perimeter](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter)**
5. **[Multi Assign](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/05-multi-assign)**
6. **[Multi Assign #2](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/06-multi-assign-2)**
7. **[Multi Short Func](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/07-multi-short-func)**
8. **[Swapper](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/08-swapper)**
9. **[Swapper #2](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/09-swapper-2)**
10. **[Discard The File](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/10-discard-the-file)**
================================================
FILE: 06-variables/04-assignment/questions/README.md
================================================
## What happens when you assign a variable to another variable?
* The variables become the same variable
* Assignee variable gets deleted
* Variable's value is changed to the assigned variable's value *CORRECT*
## Which one is a correct assignment statement?
```go
opened := true
```
* `closed := true`
* `opened = false` *CORRECT*
* `var x = 2`
## Which one is a correct assignment statement?
* `a, b = 3; 5`
* `c, d = true, false` *CORRECT*
* `a, b, c = 5, 3`
## Which one is a correct assignment?
```go
var (
n = 3
m int
)
```
* `m = "4"`
* `n = 10` *CORRECT*
* `n = true`
* `m = false`
## Which one is a correct assignment?
```go
var (
n = 3
m int
f float64
)
// one of the assignments below will be here
fmt.Println(n, m, f)
```
* `n, m = 4, f`
* `n = false`
* `n, m, f = m + n, n + 5, 0.5` *CORRECT*
* `n, m = 3.82, "hi"`
## Which one is a correct assignment statement?
```go
var (
a int
c bool
)
```
* `a = _`
* `c, _ = _, false`
* `_, _ = a, c` *CORRECT*
## Which one is a correct assignment?
**REMEMBER:** `path.Split` returns two `string` values
```go
var c, f string
```
* `_ = path.Split("assets/profile.png")`
* `_, _, c = path.Split("assets/profile.png")`
* `f = path.Split("assets/profile.png")`
* `_, f = path.Split("assets/profile.png")` *CORRECT*
================================================
FILE: 06-variables/05-type-conversion/01-destructive/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
speed := 100 // int
force := 2.5 // float64
// ERROR: invalid op
// speed = speed * force
// conversion can be a destructive operation
// `force` loses its fractional part...
speed = speed * int(force)
fmt.Println(speed)
}
================================================
FILE: 06-variables/05-type-conversion/02-correct/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
// order of conversion matters...
func main() {
speed := 100
force := 2.5
fmt.Printf("speed : %T\n", speed)
fmt.Printf("conversion: %T\n", float64(speed))
fmt.Printf("expression: %T\n", float64(speed)*force)
// TYPE MISMATCH:
// speed is int
// expression is float64
// speed = float64(speed) * force
// CORRECT: int * int
speed = int(float64(speed) * force)
fmt.Println(speed)
}
================================================
FILE: 06-variables/05-type-conversion/03-numeric-conversion/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var apple int
var orange int32
// ERROR:
// cannot assign orange to apple (different types)
// apple = orange
// you need to convert orange to apple
// orange is convertable to int because,
// int and int32 are both numeric types
apple = int(orange)
// you can't convert a numeric type to a bool:
// isDelicious := bool(orange)
// but you can convert an int to a string
// this only works with int types
orange = 65 // 65 is A
color := string(orange)
fmt.Println(color)
// this doesn't work. 65.0 is a float.
// fmt.Println(string(65.0))
// this works: there are two byte values
// byte is also an int
fmt.Println(string([]byte{104, 105}))
_ = apple
}
================================================
FILE: 06-variables/05-type-conversion/exercises/01-convert-and-fix/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Convert and Fix
//
// Fix the code by using the conversion expression.
//
// EXPECTED OUTPUT
// 15.5
// ---------------------------------------------------------
func main() {
// a, b := 10, 5.5
// fmt.Println(a + b)
}
================================================
FILE: 06-variables/05-type-conversion/exercises/01-convert-and-fix/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
a, b := 10, 5.5
fmt.Println(float64(a) + b)
}
================================================
FILE: 06-variables/05-type-conversion/exercises/02-convert-and-fix-2/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Convert and Fix #2
//
// Fix the code by using the conversion expression.
//
// EXPECTED OUTPUT
// 10.5
// ---------------------------------------------------------
func main() {
// a, b := 10, 5.5
// a = b
// fmt.Println(a + b)
}
================================================
FILE: 06-variables/05-type-conversion/exercises/02-convert-and-fix-2/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
a, b := 10, 5.5
a = int(b)
fmt.Println(float64(a) + b)
}
================================================
FILE: 06-variables/05-type-conversion/exercises/03-convert-and-fix-3/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Convert and Fix #3
//
// Fix the code.
//
// EXPECTED OUTPUT
// 5.5
// ---------------------------------------------------------
func main() {
// fmt.Println(int(5.5))
}
================================================
FILE: 06-variables/05-type-conversion/exercises/03-convert-and-fix-3/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
fmt.Println(5.5)
}
================================================
FILE: 06-variables/05-type-conversion/exercises/04-convert-and-fix-4/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Convert and Fix #4
//
// Fix the code.
//
// EXPECTED OUTPUT
// 9.5
// ---------------------------------------------------------
func main() {
// age := 2
// fmt.Println(int(7.5) + int(age))
}
================================================
FILE: 06-variables/05-type-conversion/exercises/04-convert-and-fix-4/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
age := 2
fmt.Println(7.5 + float64(age))
}
================================================
FILE: 06-variables/05-type-conversion/exercises/05-convert-and-fix-5/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
// ---------------------------------------------------------
// EXERCISE: Convert and Fix #5
//
// Fix the code.
//
// HINTS
// maximum of int8 can be 127
// maximum of int16 can be 32767
//
// EXPECTED OUTPUT
// 1127
// ---------------------------------------------------------
func main() {
// DO NOT TOUCH THESE VARIABLES
min := int8(127)
max := int16(1000)
// FIX THE CODE HERE
fmt.Println(int8(max) + min)
}
================================================
FILE: 06-variables/05-type-conversion/exercises/05-convert-and-fix-5/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
min := int8(127)
max := int16(1000)
fmt.Println(max + int16(min))
// EXPLANATION
//
// `int8(max)` destroys the information of max
// It reduces it to 127
// Which is the maximum value of int8
//
// Correct conversion is int16(min)
// Because, int16 > int8
// When you do so, min doesn't lose information
//
// You will learn more about this in
// the "Go Type System" section.
}
================================================
FILE: 06-variables/05-type-conversion/exercises/README.md
================================================
# Type Conversion
Here are 5 exercises for you. You must find the errors and then fix them using the correct type conversions.
1. **[Convert and Fix #1](https://github.com/inancgumus/learngo/tree/master/06-variables/05-type-conversion/exercises/01-convert-and-fix)**
2. **[Convert and Fix #2](https://github.com/inancgumus/learngo/tree/master/06-variables/05-type-conversion/exercises/02-convert-and-fix-2)**
3. **[Convert and Fix #3](https://github.com/inancgumus/learngo/tree/master/06-variables/05-type-conversion/exercises/03-convert-and-fix-3)**
4. **[Convert and Fix #4](https://github.com/inancgumus/learngo/tree/master/06-variables/05-type-conversion/exercises/04-convert-and-fix-4)**
5. **[Convert and Fix #5](https://github.com/inancgumus/learngo/tree/master/06-variables/05-type-conversion/exercises/05-convert-and-fix-5)**
================================================
FILE: 06-variables/05-type-conversion/questions/questions.md
================================================
## Which one is a correct type conversion expression?
* convert(40)
* var("hi")
* int(4.) *CORRECT*
* int[4]
## What does this code print?
```go
age := 6.5
fmt.Print(int(age))
```
* 6.5
* 65
* 6 *CORRECT*
* .5
> When you convert a float to integer
> It loses its fractional part
## What does this code print?
```go
fmt.Print(int(6.5))
```
* 6.5
* 65
* 6
* Compile-Time Error *CORRECT*
> Go can detect conversion errors at the compile-time
## What does this code print?
```go
area := 10.5
fmt.Print(area/2)
```
* 5.25 *CORRECT*
* 5
* 0
* Error
## What does this code print?
```go
area := 10.5
div := 2
fmt.Print(area/div)
```
* 5.25
* 5
* ERROR *CORRECT*
> You can't divide different type of values.
> You need to convert: `area / float64(div)`
## Which code below can fix the following code?
```go
area := 10.5
div := 2
fmt.Print(area/div)
```
* `fmt.Print(int(area)/div)` // 5
* `fmt.Print(area/int(div))` // type mismatch
* `fmt.Print(int(area)/int(div))` // 5
* `fmt.Print(area/float64(div))` *CORRECT*
================================================
FILE: 06-variables/06-project-greeter/01-demonstration/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"os"
)
// NOTE: RUN THIS WITH 3 ARGUMENTS AT LEAST
// OR, THERE WILL BE AN ERROR
func main() {
fmt.Printf("%#v\n", os.Args)
// Gets an item from the os.Args string slice:
// os.Args[INDEX]
// INDEX can be 0 or greater
fmt.Println("Path:", os.Args[0])
fmt.Println("1st argument:", os.Args[1])
fmt.Println("2nd argument:", os.Args[2])
fmt.Println("3rd argument:", os.Args[3])
// `len` function can find how many items
// inside a slice value
fmt.Println("Items inside os.Args:", len(os.Args))
}
================================================
FILE: 06-variables/06-project-greeter/02-version1/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"os"
)
// Since, you didn't learn about the control flow statements yet
// I didn't include an error detection here.
//
// So, if you don't pass a name,
// this program will fail.
// This is intentional.
func main() {
var name string
// assign a new value to the string variable below
name = os.Args[1]
fmt.Println("Hello great", name, "!")
// changes the name, declares the age with 85
name, age := "gandalf", 85
fmt.Println("My name is", name)
fmt.Println("My age is", age)
fmt.Println("BTW, you shall pass!")
}
================================================
FILE: 06-variables/06-project-greeter/03-version2/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"os"
)
// Since, you didn't learn about the control flow statements yet
// I didn't include an error detection here.
//
// So, if you don't pass a name,
// this program will fail.
// This is intentional.
func main() {
// assign a new value to the string variable below
name := os.Args[1]
fmt.Println("Hello great", name, "!")
// changes the name, declares the age with 85
name, age := "gandalf", 85
fmt.Println("My name is", name)
fmt.Println("My age is", age)
fmt.Println("BTW, you shall pass!")
}
================================================
FILE: 06-variables/06-project-greeter/exercises/01-count-arguments/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Count the Arguments
//
// Print the count of the command-line arguments
//
// INPUT
// bilbo balbo bungo
//
// EXPECTED OUTPUT
// There are 3 names.
// ---------------------------------------------------------
func main() {
// UNCOMMENT & FIX THIS CODE
// count := ?
// UNCOMMENT IT & THEN DO NOT TOUCH THIS CODE
// fmt.Printf("There are %d names.\n", count)
}
================================================
FILE: 06-variables/06-project-greeter/exercises/01-count-arguments/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"os"
)
func main() {
count := len(os.Args) - 1
fmt.Printf("There are %d names.\n", count)
}
================================================
FILE: 06-variables/06-project-greeter/exercises/02-print-the-path/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Print the Path
//
// Print the path of the running program by getting it
// from `os.Args` variable.
//
// HINT
// Use `go build` to build your program.
// Then run it using the compiled executable program file.
//
// EXPECTED OUTPUT SHOULD INCLUDE THIS
// myprogram
// ---------------------------------------------------------
func main() {
}
================================================
FILE: 06-variables/06-project-greeter/exercises/02-print-the-path/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"os"
)
// STEPS:
//
// Compile it by typing:
// go build -o myprogram
//
// Then run it by typing:
// ./myprogram
//
// If you're on Windows, then type:
// myprogram
func main() {
fmt.Println(os.Args[0])
}
================================================
FILE: 06-variables/06-project-greeter/exercises/03-print-your-name/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Print Your Name
//
// Get it from the first command-line argument
//
// INPUT
// Call the program using your name
//
// EXPECTED OUTPUT
// It should print your name
//
// EXAMPLE
// go run main.go inanc
//
// inanc
//
// BONUS: Make the output like this:
//
// go run main.go inanc
// Hi inanc
// How are you?
// ---------------------------------------------------------
func main() {
// get your name from the command-line
// and print it
}
================================================
FILE: 06-variables/06-project-greeter/exercises/03-print-your-name/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"os"
)
func main() {
fmt.Println(os.Args[1])
// BONUS SOLUTION:
fmt.Println("Hello", os.Args[1])
fmt.Println("How are you?")
}
================================================
FILE: 06-variables/06-project-greeter/exercises/04-greet-more-people/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Greet More People
//
// RESTRICTIONS
// 1. Be sure to match the expected output below
// 2. Store the length of the arguments in a variable
// 3. Store all the arguments in variables as well
//
// INPUT
// bilbo balbo bungo
//
// EXPECTED OUTPUT
// There are 3 people!
// Hello great bilbo !
// Hello great balbo !
// Hello great bungo !
// Nice to meet you all.
// ---------------------------------------------------------
func main() {
// TYPE YOUR CODE HERE
// BONUS #1:
// Observe the error if you pass less then 3 arguments.
// Search on the web how to solve that.
}
================================================
FILE: 06-variables/06-project-greeter/exercises/04-greet-more-people/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"os"
)
func main() {
var (
l = len(os.Args) - 1
n1 = os.Args[1]
n2 = os.Args[2]
n3 = os.Args[3]
)
fmt.Println("There are", l, "people !")
fmt.Println("Hello great", n1, "!")
fmt.Println("Hello great", n2, "!")
fmt.Println("Hello great", n3, "!")
fmt.Println("Nice to meet you all.")
}
================================================
FILE: 06-variables/06-project-greeter/exercises/05-greet-5-people/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Greet 5 People
//
// Greet 5 people this time.
//
// Please do not copy paste from the previous exercise!
//
// RESTRICTION
// This time do not use variables.
//
// INPUT
// bilbo balbo bungo gandalf legolas
//
// EXPECTED OUTPUT
// There are 5 people!
// Hello great bilbo !
// Hello great balbo !
// Hello great bungo !
// Hello great gandalf !
// Hello great legolas !
// Nice to meet you all.
// ---------------------------------------------------------
func main() {
// TYPE YOUR CODE HERE
}
================================================
FILE: 06-variables/06-project-greeter/exercises/05-greet-5-people/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"os"
)
func main() {
fmt.Println("There are", len(os.Args)-1, "people !")
fmt.Println("Hello great", os.Args[1], "!")
fmt.Println("Hello great", os.Args[2], "!")
fmt.Println("Hello great", os.Args[3], "!")
fmt.Println("Hello great", os.Args[4], "!")
fmt.Println("Hello great", os.Args[5], "!")
fmt.Println("Nice to meet you all.")
}
================================================
FILE: 06-variables/06-project-greeter/exercises/README.md
================================================
# Command Line Arguments
1. **[Count the Arguments](https://github.com/inancgumus/learngo/tree/master/06-variables/06-project-greeter/exercises/01-count-arguments)**
2. **[Print the Path](https://github.com/inancgumus/learngo/tree/master/06-variables/06-project-greeter/exercises/02-print-the-path)**
3. **[Print Your Name](https://github.com/inancgumus/learngo/tree/master/06-variables/06-project-greeter/exercises/03-print-your-name)**
4. **[Greet More People](https://github.com/inancgumus/learngo/tree/master/06-variables/06-project-greeter/exercises/04-greet-more-people)**
5. **[Greet 5 People](https://github.com/inancgumus/learngo/tree/master/06-variables/06-project-greeter/exercises/05-greet-5-people)**
================================================
FILE: 06-variables/06-project-greeter/exercises/solution-to-the-lecture-exercise/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import (
"fmt"
"os"
)
// ---------------------------------------------------------
// This is a solution to the exercise that I asked
// in the lecture.
// ---------------------------------------------------------
// NOTE: You should run this program with 3 arguments
// at least. Or there will be an error.
func main() {
// assign a new value to the string variable below
var (
name = os.Args[1]
name2 = os.Args[2]
name3 = os.Args[3]
)
fmt.Println("Hello great", name, "!")
fmt.Println("And hellooo to you magnificient", name2, "!")
fmt.Println("Welcome", name3, "!")
// changes the name, declares the age with 131
name, age := "bilbo baggins", 131 // unknown age!
fmt.Println("My name is", name)
fmt.Println("My age is", age)
fmt.Println("And, I love adventures!")
}
================================================
FILE: 06-variables/06-project-greeter/questions/questions.md
================================================
## What's does `os.Args` variable store in its first item?
* The first argument that is passed to the program
* The second argument that is passed to the program
* Path to the running program *CORRECT*
## What's the type of the `Args` variable?
```go
var Args []string
```
* string
* string array
* a slice of strings *CORRECT*
## What is the type of each value in the `Args` variable?
```go
var Args []string
```
* string *CORRECT*
* string array
* a slice of strings
## How to get the first item of the `Args` variable?
```go
var Args []string
```
* Args.0
* Args{1}
* Args[0] *CORRECT*
* Args(1)
## How to get the second item of the `Args` variable?
```go
var Args []string
```
* Args.2
* Args[1] *CORRECT*
* Args{1}
* Args(2)
## How to get the length of the `Args` variable?
```go
var Args []string
```
* length(Args)
* Args.len
* len(Args) *CORRECT*
* Args.Length
## How to get the first "argument" from the command-line?
* os.Args[0]
* os.Args[1] *CORRECT*
* os.Args[2]
* os.Args[3]
================================================
FILE: 07-printf/01-intro/01-println-vs-printf/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
ops, ok, fail := 2350, 543, 433
fmt.Println(
"total:", ops, "- success:", ok, "/", fail,
)
fmt.Printf(
"total: %d - success: %d / %d\n",
ops, ok, fail,
)
}
================================================
FILE: 07-printf/01-intro/02/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var brand string
// prints the string in quoted-form like this ""
fmt.Printf("%q\n", brand)
brand = "Google"
fmt.Printf("%q\n", brand)
}
================================================
FILE: 07-printf/02-escape-sequences/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// without newline
fmt.Println("hihi")
// with newline:
// \n = escape sequence
// \ = escape character
fmt.Println("hi\nhi")
// escape characters:
// \\ = \
// \" = "
fmt.Println("hi\\n\"hi\"")
}
================================================
FILE: 07-printf/03-printing-types/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
// I'm using multiple declarations instead of singular
var (
speed int
heat float64
off bool
brand string
)
fmt.Printf("%T\n", speed)
fmt.Printf("%T\n", heat)
fmt.Printf("%T\n", off)
fmt.Printf("%T\n", brand)
}
================================================
FILE: 07-printf/04-coding/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
var (
planet = "venus"
distance = 261
orbital = 224.701
hasLife = false
)
// swiss army knife %v verb
fmt.Printf("Planet: %v\n", planet)
fmt.Printf("Distance: %v millions kms\n", distance)
fmt.Printf("Orbital Period: %v days\n", orbital)
fmt.Printf("Does %v have life? %v\n", planet, hasLife)
// argument indexing - indexes start from 1
fmt.Printf(
"%v is %v away. Think! %[2]v kms! %[1]v OMG.\n",
planet, distance,
)
// why use other verbs than? because: type-safety
// uncomment to see the warnings:
//
// fmt.Printf("Planet: %d\n", planet)
// fmt.Printf("Distance: %s millions kms\n", distance)
// fmt.Printf("Orbital Period: %t days\n", orbital)
// fmt.Printf("Does %v has life? %f\n", planet, hasLife)
// correct verbs:
// fmt.Printf("Planet: %s\n", planet)
// fmt.Printf("Distance: %d millions kms\n", distance)
// fmt.Printf("Orbital Period: %f days\n", orbital)
// fmt.Printf("Does %s has life? %t\n", planet, hasLife)
// precision
fmt.Printf("Orbital Period: %f days\n", orbital)
fmt.Printf("Orbital Period: %.0f days\n", orbital)
fmt.Printf("Orbital Period: %.1f days\n", orbital)
fmt.Printf("Orbital Period: %.2f days\n", orbital)
}
================================================
FILE: 07-printf/exercises/01-print-your-age/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Print Your Age
//
// Print your age using Printf
//
// EXPECTED OUTPUT
// I'm 30 years old.
//
// NOTE
// You should change 30 to your age, of course.
// ---------------------------------------------------------
func main() {
// ?
}
================================================
FILE: 07-printf/exercises/01-print-your-age/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
fmt.Printf("I'm %d years old.\n", 30)
}
================================================
FILE: 07-printf/exercises/02-print-your-name-and-lastname/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Print Your Name and LastName
//
// Print your name and lastname using Printf
//
// EXPECTED OUTPUT
// My name is Inanc and my lastname is Gumus.
//
// BONUS
// Store the formatting specifier (first argument of Printf)
// in a variable.
// Then pass it to printf
// ---------------------------------------------------------
func main() {
// BONUS: Use a variable for the format specifier
// fmt.Printf("?", ?, ?)
}
================================================
FILE: 07-printf/exercises/02-print-your-name-and-lastname/solution/main.go
================================================
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
import "fmt"
func main() {
fmt.Printf("My name is %s and my lastname is %s.\n", "Inanc", "Gumus")
// BONUS
gitextract_uy2gop8w/
├── .gitignore
├── 01-get-started/
│ ├── README.md
│ ├── osx-installation.md
│ ├── programmers-roadmap.md
│ ├── ubuntu-installation.md
│ └── windows-installation.md
├── 02-write-your-first-program/
│ ├── README.md
│ ├── annotated-go-program-example.md
│ ├── exercises/
│ │ ├── 01-print-names/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ ├── main.go
│ └── questions/
│ ├── 01-gopath/
│ │ └── README.md
│ ├── 02-code-your-first-program/
│ │ └── README.md
│ └── 03-run-your-first-program/
│ └── README.md
├── 03-packages-and-scopes/
│ ├── 01-packages/
│ │ ├── bye.go
│ │ ├── hey.go
│ │ └── main.go
│ ├── 02-scopes/
│ │ ├── 01-scopes/
│ │ │ └── main.go
│ │ ├── 02-block-scope/
│ │ │ └── main.go
│ │ ├── 03-nested-scope/
│ │ │ └── main.go
│ │ └── 04-package-scope/
│ │ ├── bye.go
│ │ ├── hey.go
│ │ └── main.go
│ ├── 03-importing/
│ │ ├── 01-file-scope/
│ │ │ ├── bye.go
│ │ │ └── main.go
│ │ └── 02-renaming/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-packages/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── bye.go
│ │ │ ├── greet.go
│ │ │ └── main.go
│ │ ├── 02-scopes/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── main.go
│ │ │ └── printer.go
│ │ ├── 03-importing/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 01-packages-A/
│ │ └── README.md
│ ├── 02-packages-B/
│ │ └── README.md
│ └── 03-scopes/
│ └── README.md
├── 04-statements-expressions-comments/
│ ├── 01-statements/
│ │ ├── 01-execution-flow/
│ │ │ └── main.go
│ │ └── 02-semicolons/
│ │ └── main.go
│ ├── 02-expressions/
│ │ ├── 01-operator/
│ │ │ └── main.go
│ │ └── 02-call-expression/
│ │ └── main.go
│ ├── 03-comments/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-shy-semicolons/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-naked-expression/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-operators-combine/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-print-go-version/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-comment-out/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-use-godoc/
│ │ │ ├── exercise.md
│ │ │ └── solution/
│ │ │ └── solution.md
│ │ └── README.md
│ └── questions/
│ ├── 01-statements/
│ │ └── README.md
│ ├── 02-expressions/
│ │ └── README.md
│ └── 03-comments/
│ └── README.md
├── 05-write-your-first-library-package/
│ ├── exercise/
│ │ ├── README.md
│ │ └── solution/
│ │ └── golang/
│ │ ├── cmd/
│ │ │ └── main.go
│ │ └── go.go
│ ├── printer/
│ │ ├── cmd/
│ │ │ └── main.go
│ │ └── printer.go
│ └── questions/
│ └── README.md
├── 06-variables/
│ ├── 01-basic-data-types/
│ │ ├── exercises/
│ │ │ ├── 01-print-the-literals/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-print-hexes/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ ├── main.go
│ │ └── questions/
│ │ └── README.md
│ ├── 02-declarations/
│ │ ├── 01-declaration-syntax/
│ │ │ ├── 01-syntax/
│ │ │ │ └── main.go
│ │ │ ├── 02-naming-rules/
│ │ │ │ └── main.go
│ │ │ └── 03-order-of-declaration/
│ │ │ └── main.go
│ │ ├── 02-example-declarations/
│ │ │ ├── 01-int/
│ │ │ │ └── main.go
│ │ │ ├── 02-float64/
│ │ │ │ └── main.go
│ │ │ ├── 03-bool/
│ │ │ │ └── main.go
│ │ │ └── 04-string/
│ │ │ └── main.go
│ │ ├── 03-zero-values/
│ │ │ └── main.go
│ │ ├── 04-unused-variables-and-blank-identifier/
│ │ │ ├── 01-unused-variable/
│ │ │ │ └── main.go
│ │ │ └── 02-blank-identifier/
│ │ │ └── main.go
│ │ ├── 05-multiple-declarations/
│ │ │ ├── 01-multiple/
│ │ │ │ └── main.go
│ │ │ └── 02-parallel/
│ │ │ └── main.go
│ │ ├── 06-examples/
│ │ │ └── main.go
│ │ ├── exercises/
│ │ │ ├── 01-int/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-bool/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-float64/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-string/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-undeclarables/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 06-with-bits/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 07-multiple/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 08-multiple-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 09-unused/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 10-package-variable/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 11-wrong-doer/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── questions/
│ │ ├── 01-what/
│ │ │ └── README.md
│ │ ├── 02-declaration/
│ │ │ └── README.md
│ │ ├── 03-unused-variables/
│ │ │ └── README.md
│ │ └── 04-zero-values/
│ │ └── README.md
│ ├── 03-short-declaration/
│ │ ├── 01-initialization-and-short-declaration/
│ │ │ ├── 01-initialization/
│ │ │ │ └── main.go
│ │ │ ├── 02-short-declaration/
│ │ │ │ └── main.go
│ │ │ └── 03-coding-example/
│ │ │ └── main.go
│ │ ├── 02-package-scope/
│ │ │ └── main.go
│ │ ├── 03-multiple-short-declaration/
│ │ │ ├── 01-declaration/
│ │ │ │ └── main.go
│ │ │ ├── 02-coding-example/
│ │ │ │ └── main.go
│ │ │ └── 03-redeclaration/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02-coding-example/
│ │ │ └── main.go
│ │ ├── 04-short-vs-normal/
│ │ │ ├── 01-declaration/
│ │ │ │ └── main.go
│ │ │ └── 02-short-declaration/
│ │ │ └── main.go
│ │ ├── exercises/
│ │ │ ├── 01-short-declare/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-multiple-short-declare/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-multiple-short-declare-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-short-with-expression/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-short-discard/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 06-redeclare/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── questions/
│ │ └── README.md
│ ├── 04-assignment/
│ │ ├── 01-assignment/
│ │ │ ├── 01-assignment/
│ │ │ │ └── main.go
│ │ │ ├── 02-strongly-typed/
│ │ │ │ └── main.go
│ │ │ └── 03-examples/
│ │ │ └── main.go
│ │ ├── 01-overview/
│ │ │ └── main.go
│ │ ├── 05-multiple-assignment/
│ │ │ └── main.go
│ │ ├── 06-swapping/
│ │ │ └── main.go
│ │ ├── 07-path-project/
│ │ │ └── main.go
│ │ ├── 08-path-project-discarding/
│ │ │ └── main.go
│ │ ├── 09-path-project-shortdecl/
│ │ │ └── main.go
│ │ ├── exercises/
│ │ │ ├── 01-make-it-blue/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-vars-to-vars/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-assign-with-expressions/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-find-the-rectangle-perimeter/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-multi-assign/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 06-multi-assign-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 07-multi-short-func/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 08-swapper/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 09-swapper-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 10-discard-the-file/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── questions/
│ │ └── README.md
│ ├── 05-type-conversion/
│ │ ├── 01-destructive/
│ │ │ └── main.go
│ │ ├── 02-correct/
│ │ │ └── main.go
│ │ ├── 03-numeric-conversion/
│ │ │ └── main.go
│ │ ├── exercises/
│ │ │ ├── 01-convert-and-fix/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-convert-and-fix-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-convert-and-fix-3/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-convert-and-fix-4/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-convert-and-fix-5/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── questions/
│ │ └── questions.md
│ └── 06-project-greeter/
│ ├── 01-demonstration/
│ │ └── main.go
│ ├── 02-version1/
│ │ └── main.go
│ ├── 03-version2/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-count-arguments/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-print-the-path/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-print-your-name/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-greet-more-people/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-greet-5-people/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── README.md
│ │ └── solution-to-the-lecture-exercise/
│ │ └── main.go
│ └── questions/
│ └── questions.md
├── 07-printf/
│ ├── 01-intro/
│ │ ├── 01-println-vs-printf/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 02-escape-sequences/
│ │ └── main.go
│ ├── 03-printing-types/
│ │ └── main.go
│ ├── 04-coding/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-print-your-age/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-print-your-name-and-lastname/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-false-claims/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-print-the-temperature/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-double-quotes/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-print-the-type/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-print-the-type-2/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-print-the-type-3/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-print-the-type-4/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 10-print-your-fullname/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── questions.md
├── 08-numbers-and-strings/
│ ├── 01-numbers/
│ │ ├── 01-arithmetic-operators/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ └── 03-float-inaccuracy/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ └── 03/
│ │ │ └── main.go
│ │ ├── 02-arithmetic-operators-examples/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 03-precedence/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ ├── 03/
│ │ │ │ └── main.go
│ │ │ └── 04/
│ │ │ └── main.go
│ │ ├── 04-incdec-statement/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ └── 03/
│ │ │ └── main.go
│ │ ├── 05-assignment-operations/
│ │ │ └── main.go
│ │ ├── 06-project-feet-to-meters/
│ │ │ ├── exercise-solution/
│ │ │ │ └── main.go
│ │ │ └── main.go
│ │ ├── exercises/
│ │ │ ├── 01-do-some-calculations/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-fix-the-float/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-precedence/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-incdecs/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-manipulate-a-counter/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 06-simplify-the-assignments/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 07-circle-area/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 08-sphere-area/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 09-sphere-volume/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── questions/
│ │ ├── 01-arithmetic-operators.md
│ │ ├── 02-precedence.md
│ │ └── 03-assignment-operations.md
│ └── 02-strings/
│ ├── 01-raw-string-literal/
│ │ └── main.go
│ ├── 02-concatenation/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02-assignment-operation/
│ │ │ └── main.go
│ │ └── 03-concat-non-strings/
│ │ └── main.go
│ ├── 03-string-length/
│ │ ├── 01-len/
│ │ │ └── main.go
│ │ └── 02-unicode-len/
│ │ └── main.go
│ ├── 04-project-banger/
│ │ ├── exercise-solution/
│ │ │ └── main.go
│ │ └── main.go
│ ├── README.md
│ ├── exercises/
│ │ ├── 01-windows-path/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-print-json/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-raw-concat/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-count-the-chars/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-improved-banger/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-tolowercase/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-trim-it/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── 08-right-trim-it/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ └── questions/
│ └── questions.md
├── 09-go-type-system/
│ ├── 01-bits/
│ │ └── main.go
│ ├── 02-bytes/
│ │ └── main.go
│ ├── 03-predeclared-types/
│ │ └── main.go
│ ├── 04-overflow/
│ │ ├── 01-problem/
│ │ │ └── main.go
│ │ ├── 02-explain/
│ │ │ └── main.go
│ │ └── 03-destructive/
│ │ └── main.go
│ ├── 05-defined-types/
│ │ ├── 01-duration-example/
│ │ │ └── main.go
│ │ ├── 02-type-definition-create-your-own-type/
│ │ │ └── main.go
│ │ └── 03-underlying-types/
│ │ ├── main.go
│ │ └── weights/
│ │ └── weights.go
│ ├── 06-aliased-types/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-optimal-types/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-the-type-problem/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-parse-arg-numbers/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-time-multiplier/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-refactor-feet-to-meter/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-convert-the-types/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 01-questions-predeclared-types.md
│ └── 02-questions-defined-types.md
├── 10-constants/
│ ├── 01-declarations/
│ │ ├── 01-syntax/
│ │ │ ├── 01-magic-numbers/
│ │ │ │ └── main.go
│ │ │ ├── 02-constants/
│ │ │ │ └── main.go
│ │ │ ├── 03-safety/
│ │ │ │ └── main.go
│ │ │ └── 04-rules/
│ │ │ ├── 01-immutability/
│ │ │ │ └── main.go
│ │ │ ├── 02-runtime-func/
│ │ │ │ └── main.go
│ │ │ ├── 03-runtime-var/
│ │ │ │ └── main.go
│ │ │ └── 04-len/
│ │ │ └── main.go
│ │ ├── 02-constant-types-and-expressions/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ └── 03/
│ │ │ └── main.go
│ │ └── 03-multiple-declaration/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ └── 03/
│ │ └── main.go
│ ├── 02-typeless-constants/
│ │ ├── 01-typeless-constants/
│ │ │ └── main.go
│ │ ├── 02-typed-vs-typeless/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ ├── 03/
│ │ │ │ └── main.go
│ │ │ └── 04/
│ │ │ └── main.go
│ │ ├── 03-default-type/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ ├── 03/
│ │ │ │ └── main.go
│ │ │ ├── 04/
│ │ │ │ └── main.go
│ │ │ └── 05/
│ │ │ └── main.go
│ │ └── 04-demo/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 03-refactor-feet-to-meters/
│ │ ├── main.go
│ │ └── solution/
│ │ ├── main.go
│ │ └── without-comments/
│ │ └── main.go
│ ├── 04-iota/
│ │ ├── 01-manually/
│ │ │ └── main.go
│ │ ├── 02-with-iota/
│ │ │ └── main.go
│ │ ├── 03-expressions/
│ │ │ └── main.go
│ │ └── 04-blank-identifier/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ └── 03/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-minutes-in-weeks/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-remove-the-magic/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-constant-length/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-tau/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-area/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-no-conversions-allowed/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-iota-months/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-iota-months-2/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-iota-seasons/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── questions.md
├── 11-if/
│ ├── 01-boolean-operators/
│ │ ├── 01-comparison-operators/
│ │ │ └── main.go
│ │ ├── 02-comparison-and-assignability/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ └── 03/
│ │ │ └── main.go
│ │ └── 03-logical-operators/
│ │ ├── 01-and-operator/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 02-or-operator/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ └── 03-not-operator/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 02-if-statement/
│ │ ├── 01-if-branch/
│ │ │ └── main.go
│ │ ├── 02-else-branch/
│ │ │ └── main.go
│ │ ├── 03-else-if-branch/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 04-refactor-feet-to-meters/
│ │ │ └── main.go
│ │ └── 05-challenge-userpass/
│ │ ├── 01-1st-challenge/
│ │ │ ├── 01-challenge/
│ │ │ │ └── main.go
│ │ │ ├── 02-solution/
│ │ │ │ └── main.go
│ │ │ └── 03-solution-refactor/
│ │ │ └── main.go
│ │ └── 02-2nd-challenge/
│ │ ├── 01-challenge/
│ │ │ └── main.go
│ │ └── 02-solution/
│ │ └── main.go
│ ├── 03-error-handling/
│ │ ├── 01-itoa/
│ │ │ └── main.go
│ │ ├── 02-atoi/
│ │ │ └── main.go
│ │ ├── 03-atoi-error-handling/
│ │ │ └── main.go
│ │ └── 04-challenge-feet-to-meters/
│ │ ├── 01-challenge/
│ │ │ └── main.go
│ │ └── 02-solution/
│ │ └── main.go
│ ├── 04-short-if/
│ │ ├── 01-without-short-if/
│ │ │ └── main.go
│ │ ├── 02-with-short-if/
│ │ │ └── main.go
│ │ ├── 03-scope/
│ │ │ └── main.go
│ │ └── 04-scope-shadowing/
│ │ ├── 01-shadowing/
│ │ │ └── main.go
│ │ └── 02-shadowing-solution/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-age-seasons/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-simplify-it/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-arg-count/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-vowel-or-cons/
│ │ │ ├── main.go
│ │ │ ├── solution/
│ │ │ │ └── main.go
│ │ │ └── solution2/
│ │ │ └── main.go
│ │ ├── 05-movie-ratings/
│ │ │ ├── main.go
│ │ │ ├── solution/
│ │ │ │ └── main.go
│ │ │ └── solution2/
│ │ │ └── main.go
│ │ ├── 06-odd-even/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-leap-year/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-simplify-leap-year/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-days-in-month/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 1-comparison-operators.md
│ ├── 2-logical-operators.md
│ ├── 3-if.md
│ ├── 4-error-handling.md
│ └── 5-short-if.md
├── 12-switch/
│ ├── 01-one-case/
│ │ └── main.go
│ ├── 02-multiple-cases/
│ │ └── main.go
│ ├── 03-default-clause/
│ │ └── main.go
│ ├── 04-multiple-conditions/
│ │ └── main.go
│ ├── 05-bool-expressions/
│ │ └── main.go
│ ├── 06-fallthrough/
│ │ ├── 01-without/
│ │ │ └── main.go
│ │ └── 02-with/
│ │ └── main.go
│ ├── 07-short-switch/
│ │ └── main.go
│ ├── 08-parts-of-the-day/
│ │ └── main.go
│ ├── 09-when-to-use/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-richter-scale/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-richter-scale-2/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-convert/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-string-manipulator/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-days-in-month/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── questions.md
├── 13-loops/
│ ├── 01-basics/
│ │ └── main.go
│ ├── 02-break/
│ │ └── main.go
│ ├── 03-continue/
│ │ ├── 01-a-before/
│ │ │ └── main.go
│ │ └── 01-b-after/
│ │ └── main.go
│ ├── 04-nested-loops-multiplication-table/
│ │ └── main.go
│ ├── 05-for-range/
│ │ ├── 01-loop-over-slices/
│ │ │ └── main.go
│ │ └── 02-loop-over-words/
│ │ └── main.go
│ ├── 06-project-lucky-number-game/
│ │ ├── 01-randomization/
│ │ │ └── main.go
│ │ └── 02-game/
│ │ └── main.go
│ ├── 07-project-word-finder/
│ │ └── main.go
│ ├── 08-word-finder-labeled-break/
│ │ └── main.go
│ ├── 09-word-finder-labeled-continue/
│ │ └── main.go
│ ├── 10-word-finder-labeled-switch/
│ │ └── main.go
│ ├── 11-goto/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-basics.md
│ │ ├── 01-sum-the-numbers/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-multiplication-table.md
│ │ ├── 02-sum-the-numbers-verbose/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-lucky-number.md
│ │ ├── 03-sum-up-to-n/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-only-evens/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-word-finder.md
│ │ ├── 05-break-up/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-crunch-the-primes.md
│ │ ├── 06-infinite-kill/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-multiplication-table-exercises/
│ │ │ ├── 01-dynamic-table/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── 02-math-tables/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-lucky-number-exercises/
│ │ │ ├── 01-first-turn-winner/
│ │ │ │ ├── main.go
│ │ │ │ ├── solution/
│ │ │ │ │ └── main.go
│ │ │ │ └── solution-better/
│ │ │ │ └── main.go
│ │ │ ├── 02-random-messages/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-double-guesses/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-verbose-mode/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-enough-picks/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── 06-dynamic-difficulty/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-word-finder-exercises/
│ │ │ ├── 01-case-insensitive/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── 02-path-searcher/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 10-crunch-the-primes/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 01-loops.md
│ ├── 02-randomization.md
│ └── 03-labeled-statements.md
├── 14-arrays/
│ ├── 01-whats-an-array/
│ │ └── main.go
│ ├── 02-examples-1-hipsters-love-bookstore/
│ │ └── main.go
│ ├── 03-examples-2-hipsters-love-bookstore/
│ │ └── main.go
│ ├── 04-array-literal/
│ │ └── main.go
│ ├── 05-examples-3-hipsters-love-bookstore/
│ │ └── main.go
│ ├── 06-challenge-moodly/
│ │ ├── challenge/
│ │ │ └── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 07-compare/
│ │ └── main.go
│ ├── 08-assignment/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02-example/
│ │ └── main.go
│ ├── 09-multi-dimensional/
│ │ └── main.go
│ ├── 10-challenge-moodly-2/
│ │ ├── challenge/
│ │ │ └── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 11-keyed-elements/
│ │ ├── 01-unkeyed/
│ │ │ └── main.go
│ │ ├── 02-keyed/
│ │ │ └── main.go
│ │ ├── 03-keyed-order/
│ │ │ └── main.go
│ │ ├── 04-keyed-auto-initialize/
│ │ │ └── main.go
│ │ ├── 05-keyed-auto-initialize-ellipsis/
│ │ │ └── main.go
│ │ ├── 06-keyed-and-unkeyed/
│ │ │ └── main.go
│ │ └── 07-xratio-example/
│ │ ├── 01-without-keys/
│ │ │ └── main.go
│ │ └── 02-with-keys/
│ │ └── main.go
│ ├── 12-compare-unnamed/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-declare-empty/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-get-set-arrays/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-array-literal/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-ellipsis/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-fix/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-compare/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-assign/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-wizard-printer/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-currency-converter/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 10-hipsters-love-search/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 11-average/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 12-sorter/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 13-word-finder/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 1-array-basics.md
│ ├── 2-arrays.md
│ └── README.md
├── 15-project-retro-led-clock/
│ ├── 01-printing-the-digits/
│ │ ├── README.md
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 02-printing-the-clock/
│ │ ├── README.md
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 03-animating-the-clock/
│ │ ├── README.md
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 04-blinking-the-separators/
│ │ ├── README.md
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 05-full-annotated-solution/
│ │ └── main.go
│ ├── README.md
│ └── exercises/
│ ├── 01-refactor/
│ │ ├── main.go
│ │ └── solution/
│ │ ├── main.go
│ │ └── placeholders.go
│ ├── 02-alarm/
│ │ ├── main.go
│ │ ├── placeholders.go
│ │ └── solution/
│ │ ├── main.go
│ │ └── placeholders.go
│ ├── 03-split-second/
│ │ ├── main.go
│ │ ├── placeholders.go
│ │ └── solution/
│ │ ├── main.go
│ │ └── placeholders.go
│ ├── 04-ticker/
│ │ ├── main.go
│ │ ├── placeholders.go
│ │ └── solution/
│ │ ├── main.go
│ │ └── placeholders.go
│ └── README.md
├── 16-slices/
│ ├── 01-slices-vs-arrays/
│ │ └── main.go
│ ├── 02-slices-vs-arrays/
│ │ └── main.go
│ ├── 03-slices-vs-arrays-examples/
│ │ └── main.go
│ ├── 04-slices-vs-arrays-unique-nums/
│ │ ├── 01-with-arrays/
│ │ │ └── main.go
│ │ └── 02-with-slices/
│ │ └── main.go
│ ├── 05-append/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 06-slice-expressions/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 07-slice-expressions-pagination/
│ │ └── main.go
│ ├── 08-slice-internals-1-backing-array/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 09-slice-internals-2-slice-header/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 10-slice-internals-3-len-cap/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 11-slice-internals-4-append/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ ├── 2-example/
│ │ │ └── main.go
│ │ ├── 3-example-growth/
│ │ │ └── main.go
│ │ └── 4-example-growth/
│ │ └── main.go
│ ├── 12-full-slice-expressions/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 13-make/
│ │ ├── 1-theory/
│ │ │ └── main.go
│ │ └── 2-example/
│ │ └── main.go
│ ├── 14-copy/
│ │ ├── 01-usage/
│ │ │ └── main.go
│ │ └── 02-hacker-incident/
│ │ └── main.go
│ ├── 15-multi-dimensional-slices/
│ │ ├── version-1/
│ │ │ └── main.go
│ │ ├── version-2/
│ │ │ └── main.go
│ │ └── version-3/
│ │ └── main.go
│ ├── README.md
│ ├── exercises/
│ │ ├── 01-declare-nil/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-empty/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-slice-literal/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-declare-arrays-as-slices/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-fix-the-problems/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-compare-the-slices/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 07-append/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 08-append-2/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 09-append-3-fix/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 10-append-sort-nums/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 11-housing-prices/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 12-housing-prices-averages/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 13-slicing-basics/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 14-slicing-by-args/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 15-slicing-housing-prices/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 16-internals-backing-array-fix/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 17-internals-backing-array-sort/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 18-internals-slice-header/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 19-observe-len-cap/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 20-observe-the-cap-growth/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 21-correct-the-lyric/
│ │ │ ├── hints.md
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 22-adv-ops-practice/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 23-limit-the-backing-array-sharing/
│ │ │ ├── api/
│ │ │ │ └── api.go
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── api/
│ │ │ │ └── api.go
│ │ │ └── main.go
│ │ ├── 24-fix-the-memory-leak/
│ │ │ ├── api/
│ │ │ │ └── api.go
│ │ │ ├── hints.md
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── api/
│ │ │ │ └── api.go
│ │ │ └── main.go
│ │ ├── 25-add-lines/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 26-print-daily-requests/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ ├── 1-slices-vs-arrays.md
│ ├── 2-appending.md
│ ├── 3-slicing.md
│ ├── 4-backing-array.md
│ ├── 5-slice-header.md
│ ├── 6-capacity.md
│ ├── 7-mechanics-of-append.md
│ ├── 8-advanced-ops.md
│ └── README.md
├── 17-project-empty-file-finder/
│ ├── 01-fetch-the-files/
│ │ ├── files/
│ │ │ ├── empty1.txt
│ │ │ ├── empty2.txt
│ │ │ ├── empty3.txt
│ │ │ ├── nonEmpty1.txt
│ │ │ ├── nonEmpty2.txt
│ │ │ └── nonEmpty3.txt
│ │ └── main.go
│ ├── 02-write-to-a-file/
│ │ ├── files/
│ │ │ ├── empty1.txt
│ │ │ ├── empty2.txt
│ │ │ ├── empty3.txt
│ │ │ ├── nonEmpty1.txt
│ │ │ ├── nonEmpty2.txt
│ │ │ └── nonEmpty3.txt
│ │ └── main.go
│ ├── 03-optimize/
│ │ ├── files/
│ │ │ ├── empty1.txt
│ │ │ ├── empty2.txt
│ │ │ ├── empty3.txt
│ │ │ ├── nonEmpty1.txt
│ │ │ ├── nonEmpty2.txt
│ │ │ └── nonEmpty3.txt
│ │ └── main.go
│ └── exercises/
│ ├── 1-sort-to-a-file/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 2-sort-to-a-file-2/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 3-print-directories/
│ │ ├── main.go
│ │ └── solution/
│ │ ├── dir/
│ │ │ ├── .gitignore
│ │ │ ├── subdir1/
│ │ │ │ └── .gitignore
│ │ │ └── subdir2/
│ │ │ └── .gitignore
│ │ ├── dir2/
│ │ │ ├── .gitignore
│ │ │ ├── subdir1/
│ │ │ │ └── .gitignore
│ │ │ ├── subdir2/
│ │ │ │ └── .gitignore
│ │ │ └── subdir3/
│ │ │ └── .gitignore
│ │ ├── dirs.txt
│ │ └── main.go
│ └── README.md
├── 18-project-bouncing-ball/
│ ├── 01-draw-the-board/
│ │ └── main.go
│ ├── 02-add-a-buffer/
│ │ └── main.go
│ ├── 03-animate/
│ │ └── main.go
│ ├── README.md
│ └── exercises/
│ ├── 01-find-the-bug/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 02-width-and-height/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 03-previous-positions/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 04-single-dimensional/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ ├── 05-no-slice/
│ │ ├── main.go
│ │ └── solution/
│ │ └── main.go
│ └── README.md
├── 19-strings-runes-bytes/
│ ├── 01-bytes-runes-strings-basics/
│ │ └── main.go
│ ├── 02-bytes-runes-strings-charset-table/
│ │ └── main.go
│ ├── 03-bytes-runes-strings-examples/
│ │ └── main.go
│ ├── 04-rune-decoding/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ ├── benchmarks/
│ │ │ └── main.go
│ │ └── main.go
│ ├── 05-internals/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-convert/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-print-the-runes/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-rune-manipulator/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── README.md
├── 20-project-spam-masker/
│ ├── 01-step-1/
│ │ ├── main.go
│ │ └── spam.txt
│ ├── 02-step-2/
│ │ ├── main.go
│ │ └── spam.txt
│ ├── 03-step-2-no-append/
│ │ ├── main.go
│ │ └── spam.txt
│ └── README.md
├── 21-project-text-wrapper/
│ ├── README.md
│ ├── main.go
│ └── story.txt
├── 22-maps/
│ ├── 01-english-dict/
│ │ ├── 01-as-a-slice/
│ │ │ └── main.go
│ │ └── 02-as-a-map/
│ │ └── main.go
│ ├── 02-english-dict-map-populate/
│ │ └── main.go
│ ├── 03-internals-cloning/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-warm-up/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-populate/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-students/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── README.md
├── 23-input-scanning/
│ ├── 01-scanning/
│ │ ├── main.go
│ │ └── proverbs.txt
│ ├── 02-map-as-sets/
│ │ ├── main.go
│ │ └── shakespeare.txt
│ ├── 03-project-log-parser/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-uppercaser/
│ │ │ ├── main.go
│ │ │ ├── shakespeare.txt
│ │ │ └── solution/
│ │ │ ├── main.go
│ │ │ └── shakespeare.txt
│ │ ├── 02-unique-words/
│ │ │ ├── main.go
│ │ │ ├── shakespeare.txt
│ │ │ └── solution/
│ │ │ ├── main.go
│ │ │ └── shakespeare.txt
│ │ ├── 03-unique-words-2/
│ │ │ ├── main.go
│ │ │ ├── shakespeare.txt
│ │ │ └── solution/
│ │ │ ├── main.go
│ │ │ └── shakespeare.txt
│ │ ├── 04-grep/
│ │ │ ├── main.go
│ │ │ ├── shakespeare.txt
│ │ │ └── solution/
│ │ │ ├── main.go
│ │ │ └── shakespeare.txt
│ │ ├── 05-quit/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 06-log-parser/
│ │ │ ├── log.txt
│ │ │ ├── log_err_missing.txt
│ │ │ ├── log_err_negative.txt
│ │ │ ├── log_err_str.txt
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── README.md
├── 24-structs/
│ ├── 01-intro/
│ │ └── main.go
│ ├── 02-basics/
│ │ └── main.go
│ ├── 03-compare-assign/
│ │ └── main.go
│ ├── 04-embedding/
│ │ └── main.go
│ ├── 05-project-log-parser-structs/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ └── main.go
│ ├── 06-encoding/
│ │ └── main.go
│ ├── 07-decoding/
│ │ ├── main.go
│ │ └── users.json
│ ├── 08-decoding-2/
│ │ ├── main.go
│ │ └── users.json
│ ├── exercises/
│ │ ├── 01-warmup/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-list/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-query-by-id/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-encode/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-decode/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── questions/
│ └── README.md
├── 25-functions/
│ ├── 01-basics/
│ │ ├── bad.go
│ │ └── main.go
│ ├── 02-basics/
│ │ └── main.go
│ ├── 03-refactor-to-funcs/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── 04-pass-by-value-semantics/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── exercises/
│ │ ├── README.md
│ │ ├── refactor-to-funcs-1/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── games.go
│ │ │ └── main.go
│ │ ├── refactor-to-funcs-2/
│ │ │ ├── games.go
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── commands.go
│ │ │ ├── games.go
│ │ │ └── main.go
│ │ ├── refactor-to-funcs-3/
│ │ │ ├── commands.go
│ │ │ ├── games.go
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ ├── commands.go
│ │ │ ├── games.go
│ │ │ └── main.go
│ │ └── rewrite-log-parser-using-funcs/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ └── main.go
│ └── questions/
│ └── README.md
├── 26-pointers/
│ ├── 01-pointers/
│ │ └── main.go
│ ├── 02-pointers-basic-examples/
│ │ └── main.go
│ ├── 03-pointers-composites/
│ │ └── main.go
│ ├── 04-log-parser-pointers/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── 05-log-parser-pointers-vs-values/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── exercises/
│ │ ├── 01-basics/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 02-swap/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 03-fix-the-crash/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 04-simplify/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── 05-log-parser/
│ │ │ ├── log.txt
│ │ │ ├── log_err_missing.txt
│ │ │ ├── log_err_negative.txt
│ │ │ ├── log_err_str.txt
│ │ │ ├── main.go
│ │ │ └── parser.go
│ │ └── README.md
│ └── questions/
│ └── README.md
├── LICENSE
├── README.md
├── advfuncs/
│ ├── 01-variadic-funcs/
│ │ └── main.go
│ ├── 02-func-values/
│ │ └── main.go
│ ├── 03-func-to-func/
│ │ └── main.go
│ ├── 04-closures/
│ │ └── main.go
│ ├── 05-higher-order-funcs/
│ │ └── main.go
│ ├── 06-functional-programming/
│ │ └── main.go
│ ├── 07-deferred-funcs/
│ │ └── main.go
│ ├── 08-png-detector/
│ │ └── main.go
│ ├── 08-png-detector-with-panic/
│ │ └── main.go
│ ├── 10-image-detector-recover/
│ │ └── main.go
│ ├── 10b-named-params/
│ │ └── main.go
│ ├── exercises/
│ │ ├── 01-refactor/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ └── README.md
│ └── new/
│ └── 01-intro/
│ ├── funcval/
│ │ └── main.go
│ └── passfunc/
│ └── main.go
├── assets/
│ └── database.json
├── concurrency/
│ └── xxx-monte-carlo/
│ └── main.go
├── etc/
│ ├── FIX.md
│ └── stratch/
│ └── main.go
├── first/
│ ├── README.md
│ ├── explain/
│ │ ├── comments/
│ │ │ └── main.go
│ │ ├── expressions/
│ │ │ ├── 01-operator/
│ │ │ │ └── main.go
│ │ │ ├── 02-call-expression/
│ │ │ │ └── main.go
│ │ │ └── README
│ │ ├── importing/
│ │ │ ├── 01-file-scope/
│ │ │ │ └── main.go
│ │ │ └── 02-renaming/
│ │ │ └── main.go
│ │ ├── packages/
│ │ │ ├── scopes/
│ │ │ │ ├── bye.go
│ │ │ │ ├── hey.go
│ │ │ │ └── main.go
│ │ │ └── what/
│ │ │ ├── bye.go
│ │ │ ├── hey.go
│ │ │ └── main.go
│ │ ├── scopes/
│ │ │ ├── 01-scopes/
│ │ │ │ └── main.go
│ │ │ ├── 02-block-scope/
│ │ │ │ └── main.go
│ │ │ └── 03-nested-scope/
│ │ │ └── main.go
│ │ └── statements/
│ │ ├── 01-execution-flow/
│ │ │ └── main.go
│ │ └── 02-semicolons/
│ │ └── main.go
│ ├── first/
│ │ ├── exercises/
│ │ │ └── 01/
│ │ │ ├── main.go
│ │ │ └── solution/
│ │ │ └── main.go
│ │ ├── main.go
│ │ └── questions/
│ │ ├── 01-code-your-first-program-questions.md
│ │ └── 02-run-your-first-program-questions.md
│ ├── printer/
│ │ ├── cmd/
│ │ │ └── main.go
│ │ └── printer.go
│ └── printer-exercise/
│ └── solution/
│ └── golang/
│ ├── cmd/
│ │ └── main.go
│ └── go.go
├── go.mod
├── go.sum
├── interfaces/
│ ├── 01-methods/
│ │ ├── book.go
│ │ ├── game.go
│ │ └── main.go
│ ├── 02-receivers/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── huge.go
│ │ └── main.go
│ ├── 03-nonstructs/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ └── money.go
│ ├── 04-interfaces/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── power/
│ │ │ ├── blender.go
│ │ │ ├── kettle.go
│ │ │ ├── main.go
│ │ │ ├── mixer.go
│ │ │ ├── player.go
│ │ │ └── socket.go
│ │ └── puzzle.go
│ ├── 05-type-assertion/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── puzzle.go
│ │ └── toy.go
│ ├── 06-empty-interface/
│ │ ├── book.go
│ │ ├── empty/
│ │ │ └── main.go
│ │ ├── empty2/
│ │ │ └── main.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── puzzle.go
│ │ └── toy.go
│ ├── 07-type-switch/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── puzzle.go
│ │ └── toy.go
│ ├── 08-promoted-methods/
│ │ ├── book.go
│ │ ├── game.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── product.go
│ │ ├── puzzle.go
│ │ └── toy.go
│ ├── 09-little-refactor/
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── product.go
│ │ └── timestamp.go
│ ├── 10-stringer/
│ │ ├── _handlemethods.go
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── product.go
│ │ └── timestamp.go
│ ├── 11-sort/
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── product.go
│ │ └── timestamp.go
│ ├── 12-marshaler/
│ │ ├── database.json
│ │ ├── list.go
│ │ ├── main.go
│ │ ├── money.go
│ │ ├── product.go
│ │ └── timestamp.go
│ ├── 13-io/
│ │ ├── alice.txt
│ │ └── main.go
│ ├── 14-io-reusable/
│ │ └── main.go
│ ├── 15-png-detector/
│ │ ├── .gitignore
│ │ └── main.go
│ ├── 16-io-compose/
│ │ ├── .gitignore
│ │ └── main.go
│ ├── 17-write-an-io-reader/
│ │ ├── .gitignore
│ │ ├── main.go
│ │ └── reader.go
│ └── 18-testing/
│ ├── .gitignore
│ ├── main.go
│ ├── reader.go
│ └── reader_test.go
├── logparser/
│ ├── functional/
│ │ ├── Makefile
│ │ ├── chartwriter.go
│ │ ├── field.go
│ │ ├── filters.go
│ │ ├── groupers.go
│ │ ├── main.go
│ │ ├── pipeline.go
│ │ ├── result.go
│ │ ├── textreader.go
│ │ └── textwriter.go
│ ├── logs/
│ │ ├── Makefile
│ │ ├── log.jsonl
│ │ ├── log.txt
│ │ ├── log_err_missing.jsonl
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.jsonl
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.jsonl
│ │ └── log_err_str.txt
│ ├── testing/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ ├── main_test.go
│ │ ├── report/
│ │ │ ├── parser.go
│ │ │ ├── parser_test.go
│ │ │ ├── result.go
│ │ │ ├── summary.go
│ │ │ └── summary_test.go
│ │ └── summarize.go
│ ├── v1/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ └── main.go
│ ├── v2/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ └── main.go
│ ├── v3/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── v4/
│ │ ├── log.txt
│ │ ├── log_err_missing.txt
│ │ ├── log_err_negative.txt
│ │ ├── log_err_str.txt
│ │ ├── main.go
│ │ └── parser.go
│ ├── v5/
│ │ ├── Makefile
│ │ ├── filepipe.go
│ │ ├── main.go
│ │ ├── passthrough.go
│ │ └── pipe/
│ │ ├── chartreport.go
│ │ ├── close.go
│ │ ├── filter.go
│ │ ├── filters.go
│ │ ├── group.go
│ │ ├── groupers.go
│ │ ├── jsonlog.go
│ │ ├── jsonreport.go
│ │ ├── logcount.go
│ │ ├── pipe.go
│ │ ├── pipeline.go
│ │ ├── record.go
│ │ ├── recordshare.go
│ │ ├── textlog.go
│ │ └── textreport.go
│ └── v6/
│ ├── logly/
│ │ ├── parse/
│ │ │ ├── count.go
│ │ │ ├── json.go
│ │ │ ├── parser.go
│ │ │ └── text.go
│ │ ├── record/
│ │ │ ├── json.go
│ │ │ ├── record.go
│ │ │ ├── sum.go
│ │ │ ├── text.go
│ │ │ └── validate.go
│ │ └── report/
│ │ ├── json.go
│ │ └── text.go
│ └── main.go
├── magic/
│ └── detect.go
├── magicpanic/
│ └── detect.go
├── main.go
├── translation/
│ ├── README.md
│ ├── chinese/
│ │ ├── 01-安装与介绍/
│ │ │ ├── README.md
│ │ │ ├── osx-安装指南.md
│ │ │ ├── ubuntu-安装指南.md
│ │ │ ├── windows-安装指南.md
│ │ │ └── 学习路线.md
│ │ ├── 02-编写第一个程序/
│ │ │ ├── README.md
│ │ │ ├── main.go
│ │ │ ├── 带注释的 GO 程序.md
│ │ │ ├── 练习/
│ │ │ │ ├── 01-print-names/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ └── README.md
│ │ │ └── 问题/
│ │ │ ├── 01-gopath/
│ │ │ │ └── README.md
│ │ │ ├── 02-code-your-first-program/
│ │ │ │ └── README.md
│ │ │ └── 03-run-your-first-program/
│ │ │ └── README.md
│ │ ├── 03-包和作用域/
│ │ │ ├── 01-packages/
│ │ │ │ ├── bye.go
│ │ │ │ ├── hey.go
│ │ │ │ └── main.go
│ │ │ ├── 02-scopes/
│ │ │ │ ├── 01-scopes/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-block-scope/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-nested-scope/
│ │ │ │ │ └── main.go
│ │ │ │ └── 04-package-scope/
│ │ │ │ ├── bye.go
│ │ │ │ ├── hey.go
│ │ │ │ └── main.go
│ │ │ ├── 03-importing/
│ │ │ │ ├── 01-file-scope/
│ │ │ │ │ ├── bye.go
│ │ │ │ │ └── main.go
│ │ │ │ └── 02-renaming/
│ │ │ │ └── main.go
│ │ │ ├── 练习/
│ │ │ │ ├── 01-packages/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ ├── bye.go
│ │ │ │ │ ├── greet.go
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-scopes/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── printer.go
│ │ │ │ ├── 03-importing/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ └── README.md
│ │ │ └── 问题/
│ │ │ ├── 01-packages-A/
│ │ │ │ └── README.md
│ │ │ ├── 02-packages-B/
│ │ │ │ └── README.md
│ │ │ └── 03-scopes/
│ │ │ └── README.md
│ │ ├── 04-语句-表达式-注释/
│ │ │ ├── 01-statements/
│ │ │ │ ├── 01-execution-flow/
│ │ │ │ │ └── main.go
│ │ │ │ └── 02-semicolons/
│ │ │ │ └── main.go
│ │ │ ├── 02-expressions/
│ │ │ │ ├── 01-operator/
│ │ │ │ │ └── main.go
│ │ │ │ └── 02-call-expression/
│ │ │ │ └── main.go
│ │ │ ├── 03-comments/
│ │ │ │ └── main.go
│ │ │ ├── 练习/
│ │ │ │ ├── 01-shy-semicolons/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-naked-expression/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-operators-combine/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 04-print-go-version/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 05-comment-out/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 06-use-godoc/
│ │ │ │ │ ├── exercise.md
│ │ │ │ │ └── solution/
│ │ │ │ │ └── solution.md
│ │ │ │ └── README.md
│ │ │ └── 问题/
│ │ │ ├── 01-statements/
│ │ │ │ └── README.md
│ │ │ ├── 02-expressions/
│ │ │ │ └── README.md
│ │ │ └── 03-comments/
│ │ │ └── README.md
│ │ ├── 05-编写你的第一个库程序包/
│ │ │ ├── printer/
│ │ │ │ ├── cmd/
│ │ │ │ │ └── main.go
│ │ │ │ └── printer.go
│ │ │ ├── 练习/
│ │ │ │ ├── README.md
│ │ │ │ └── solution/
│ │ │ │ └── golang/
│ │ │ │ ├── cmd/
│ │ │ │ │ └── main.go
│ │ │ │ └── go.go
│ │ │ └── 问题/
│ │ │ └── README.md
│ │ ├── 06-变量/
│ │ │ ├── 01-基础数据类型/
│ │ │ │ ├── main.go
│ │ │ │ ├── 练习/
│ │ │ │ │ ├── 01-print-the-literals/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-print-hexes/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── README.md
│ │ │ │ └── 问题/
│ │ │ │ └── README.md
│ │ │ ├── 02-声明/
│ │ │ │ ├── 01-声明语法/
│ │ │ │ │ ├── 01-语法/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-命名规则/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 03-声明顺序/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-声明示例/
│ │ │ │ │ ├── 01-int/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-float64/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 03-bool/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 04-string/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-零值/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 04-未使用的变量和空白标识符/
│ │ │ │ │ ├── 01-未使用的变量/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 02-空白标识符/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 05-多重声明/
│ │ │ │ │ ├── 01-多重声明/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 02-平行声明/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 06-例子/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 练习/
│ │ │ │ │ ├── 01-int/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-bool/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 03-float64/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 04-string/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 05-undeclarables/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 06-with-bits/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 07-multiple/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 08-multiple-2/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 09-unused/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 10-package-variable/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 11-wrong-doer/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── README.md
│ │ │ │ └── 问题/
│ │ │ │ ├── 01-what/
│ │ │ │ │ └── README.md
│ │ │ │ ├── 02-declaration/
│ │ │ │ │ └── README.md
│ │ │ │ ├── 03-unused-variables/
│ │ │ │ │ └── README.md
│ │ │ │ └── 04-zero-values/
│ │ │ │ └── README.md
│ │ │ ├── 03-简短声明/
│ │ │ │ ├── 01-初始化以及简短声明/
│ │ │ │ │ ├── 01-初始化/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-简短声明/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 03-编码示例/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-包作用域/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-多重简短声明/
│ │ │ │ │ ├── 01-声明/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-编码示例/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 03-重声明/
│ │ │ │ │ ├── 01/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 02-编码示例/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 04-简短-vs-正常/
│ │ │ │ │ ├── 01-声明/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 02-简短声明/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 练习/
│ │ │ │ │ ├── 01-short-declare/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-multiple-short-declare/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 03-multiple-short-declare-2/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 04-short-with-expression/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 05-short-discard/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 06-redeclare/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── README.md
│ │ │ │ └── 问题/
│ │ │ │ └── README.md
│ │ │ ├── 04-赋值/
│ │ │ │ ├── 01-概述/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 01-赋值/
│ │ │ │ │ ├── 01-赋值/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-强类型/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 03-例子/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 05-多重赋值/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 06-交换/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 07-路径/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 08-路径丢弃/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 09-路径简短声明/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 练习/
│ │ │ │ │ ├── 01-make-it-blue/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-vars-to-vars/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 03-assign-with-expressions/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 04-find-the-rectangle-perimeter/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 05-multi-assign/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 06-multi-assign-2/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 07-multi-short-func/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 08-swapper/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 09-swapper-2/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 10-discard-the-file/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── README.md
│ │ │ │ └── 问题/
│ │ │ │ └── README.md
│ │ │ ├── 05-类型转换/
│ │ │ │ ├── 01-破坏性的/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-正确的/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-数型转换/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 练习/
│ │ │ │ │ ├── 01-convert-and-fix/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02-convert-and-fix-2/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 03-convert-and-fix-3/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 04-convert-and-fix-4/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 05-convert-and-fix-5/
│ │ │ │ │ │ ├── main.go
│ │ │ │ │ │ └── solution/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── README.md
│ │ │ │ └── 问题/
│ │ │ │ └── questions.md
│ │ │ └── 06-问候员项目/
│ │ │ ├── 01-演示/
│ │ │ │ └── main.go
│ │ │ ├── 02-版本1/
│ │ │ │ └── main.go
│ │ │ ├── 03-版本2/
│ │ │ │ └── main.go
│ │ │ ├── 练习/
│ │ │ │ ├── 01-count-arguments/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02-print-the-path/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03-print-your-name/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 04-greet-more-people/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 05-greet-5-people/
│ │ │ │ │ ├── main.go
│ │ │ │ │ └── solution/
│ │ │ │ │ └── main.go
│ │ │ │ ├── README.md
│ │ │ │ └── solution-to-the-lecture-exercise/
│ │ │ │ └── main.go
│ │ │ └── 问题/
│ │ │ └── questions.md
│ │ └── 07-打印/
│ │ ├── 01-介绍/
│ │ │ ├── 01-println-vs-printf/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 02-转义序列/
│ │ │ └── main.go
│ │ ├── 03-打印类型/
│ │ │ └── main.go
│ │ ├── 04-编程/
│ │ │ └── main.go
│ │ ├── 练习/
│ │ │ ├── 01-print-your-age/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 02-print-your-name-and-lastname/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 03-false-claims/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 04-print-the-temperature/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 05-double-quotes/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 06-print-the-type/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 07-print-the-type-2/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 08-print-the-type-3/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 09-print-the-type-4/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ ├── 10-print-your-fullname/
│ │ │ │ ├── main.go
│ │ │ │ └── solution/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── 问题/
│ │ └── questions.md
│ └── spanish/
│ ├── 01-empecemos/
│ │ ├── README.md
│ │ ├── instalacion-osx.md
│ │ ├── instalacion-ubuntu.md
│ │ └── instalacion-windows.md
│ ├── 02-tu-primer-programa/
│ │ ├── README.md
│ │ ├── anotaciones-ejemplo-programa-go.md
│ │ ├── ejercicios/
│ │ │ ├── 01-imprimiendo-nombres/
│ │ │ │ ├── main.go
│ │ │ │ └── solucion/
│ │ │ │ └── main.go
│ │ │ ├── 02-imprimiendo-gopath/
│ │ │ │ ├── ejercicio.md
│ │ │ │ └── solucion/
│ │ │ │ └── solucion.md
│ │ │ └── README.md
│ │ └── main.go
│ ├── 03-paquetes-y-funciones/
│ │ ├── 01-paquetes/
│ │ │ ├── bye.go
│ │ │ ├── hey.go
│ │ │ └── main.go
│ │ ├── 02-funciones/
│ │ │ ├── 01-funciones/
│ │ │ │ └── main.go
│ │ │ ├── 02-bloque-de-funcion/
│ │ │ │ └── main.go
│ │ │ ├── 03-funciones-anidadas/
│ │ │ │ └── main.go
│ │ │ └── 04-funcion-del-paquete/
│ │ │ ├── bye.go
│ │ │ ├── hey.go
│ │ │ └── main.go
│ │ ├── 03-importando/
│ │ │ ├── 01-funcion-del-archivo/
│ │ │ │ ├── bye.go
│ │ │ │ └── main.go
│ │ │ └── 02-renombrando/
│ │ │ └── main.go
│ │ ├── ejercicios/
│ │ │ ├── 01-paquetes/
│ │ │ │ ├── main.go
│ │ │ │ └── solucion/
│ │ │ │ ├── bye.go
│ │ │ │ ├── greet.go
│ │ │ │ └── main.go
│ │ │ ├── 02-scopes/
│ │ │ │ ├── main.go
│ │ │ │ └── solucion/
│ │ │ │ ├── main.go
│ │ │ │ └── printer.go
│ │ │ ├── 03-importando/
│ │ │ │ ├── main.go
│ │ │ │ └── solucion/
│ │ │ │ └── main.go
│ │ │ └── README.md
│ │ └── preguntas/
│ │ ├── 01-paquetes-A/
│ │ │ └── README.md
│ │ ├── 02-paquete-B/
│ │ │ └── README.md
│ │ └── 03-funciones/
│ │ └── README.md
│ └── README.md
└── x-tba/
├── README.md
├── foundations/
│ ├── 01-print-args/
│ │ ├── 01-printf/
│ │ │ └── main.go
│ │ └── main.go
│ ├── 02-variables/
│ │ ├── 01-basics/
│ │ │ └── main.go
│ │ ├── 02-short-discard/
│ │ │ └── main.go
│ │ ├── 03-conversion/
│ │ │ └── main.go
│ │ └── types/
│ │ └── main.go
│ ├── 03-if-switch-loop/
│ │ ├── 01-for-crunch-the-primes/
│ │ │ └── main.go
│ │ ├── 02-switch-months/
│ │ │ └── main.go
│ │ ├── 03-math-table-if-switch-loop/
│ │ │ └── main.go
│ │ ├── 04-lucky-number-if-for-switch/
│ │ │ └── main.go
│ │ └── 05-path-searcher-for-range/
│ │ └── main.go
│ ├── area-of-a-circle/
│ │ └── main.go
│ ├── calc/
│ │ ├── 01-shortdecl-int-conv/
│ │ │ └── main.go
│ │ ├── 02-if/
│ │ │ └── main.go
│ │ ├── 03-floats-conv/
│ │ │ └── main.go
│ │ ├── 04-error-handling/
│ │ │ └── main.go
│ │ ├── 05-switch/
│ │ │ └── main.go
│ │ ├── 06-switch/
│ │ │ └── main.go
│ │ ├── 07/
│ │ │ └── main.go
│ │ ├── 08-funcs/
│ │ │ └── main.go
│ │ ├── 09-packages/
│ │ │ ├── calc/
│ │ │ │ └── calc.go
│ │ │ └── main.go
│ │ └── calc-scanner/
│ │ ├── calculations.txt
│ │ └── main.go
│ ├── cels-to-fahr/
│ │ └── main.go
│ ├── counter/
│ │ └── main.go
│ ├── feet-to-meters/
│ │ └── main.go
│ ├── lookup/
│ │ └── main.go
│ └── volume-of-a-sphere/
│ └── main.go
├── project-png-parser/
│ └── png-parser-project/
│ ├── 1-png-anatomy-format.md
│ ├── 2-png-anatomy-example.md
│ └── main.go
├── slicing-allocs-gotcha/
│ ├── main.go
│ └── nums/
│ └── main.go
├── swapi-api-client/
│ ├── fetch/
│ │ └── main.go
│ ├── film.go
│ ├── main.go
│ ├── request.go
│ ├── starship.go
│ └── swapi.go
├── tictactoe/
│ ├── 00-print/
│ │ └── main.go
│ ├── 01-vars/
│ │ └── main.go
│ ├── 02-short-decl/
│ │ └── main.go
│ ├── 03-consts/
│ │ └── main.go
│ ├── 04-funcs/
│ │ └── main.go
│ ├── 05-testing/
│ │ ├── board_test.go
│ │ └── main.go
│ ├── 06-if-switch/
│ │ ├── board_test.go
│ │ └── main.go
│ ├── 07-loop/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── main.go
│ │ └── skin.go
│ ├── 08-multi-loop/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── main.go
│ │ └── skin.go
│ ├── 09-slices/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ └── skin.go
│ ├── 10-arrays/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ └── skin.go
│ ├── 11-randomization/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ └── skin.go
│ ├── 12-infinite-loop/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ └── skin.go
│ ├── 13-detect-winning/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── ending.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ └── skin.go
│ ├── 14-more-tests/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── ending.go
│ │ ├── ending_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ ├── play_test.go
│ │ └── skin.go
│ ├── 15-os-args/
│ │ ├── board.go
│ │ ├── board_test.go
│ │ ├── ending.go
│ │ ├── ending_test.go
│ │ ├── init.go
│ │ ├── main.go
│ │ ├── play.go
│ │ ├── play_test.go
│ │ ├── skin.go
│ │ └── turn.go
│ └── 16-types/
│ ├── board.go
│ ├── board_test.go
│ ├── ending.go
│ ├── ending_test.go
│ ├── init.go
│ ├── main.go
│ ├── play.go
│ ├── play_test.go
│ ├── skin.go
│ └── turn.go
├── tictactoe-experiments/
│ ├── 00-without-bufio/
│ │ └── main.go
│ ├── 01-without-funcs/
│ │ └── main.go
│ ├── 02-with-funcs/
│ │ └── main.go
│ ├── 03-with-structs/
│ │ └── main.go
│ ├── 04-with-methods/
│ │ └── main.go
│ ├── 05-with-pointers/
│ │ └── main.go
│ ├── 06-refactor/
│ │ ├── game.go
│ │ ├── logger.go
│ │ ├── main.go
│ │ ├── resources.md
│ │ └── skins.go
│ └── README.md
└── wizards-structs/
├── marshal/
│ └── main.go
├── server/
│ ├── list.tmpl.html
│ ├── main.go
│ ├── store.go
│ └── templates.go
└── unmarshal/
└── main.go
SYMBOL INDEX (2055 symbols across 1231 files)
FILE: 02-write-your-first-program/exercises/01-print-names/main.go
function main (line 26) | func main() {
FILE: 02-write-your-first-program/exercises/01-print-names/solution/main.go
function main (line 18) | func main() {
FILE: 02-write-your-first-program/main.go
function main (line 32) | func main() {
FILE: 03-packages-and-scopes/01-packages/bye.go
function bye (line 13) | func bye() {
FILE: 03-packages-and-scopes/01-packages/hey.go
function hey (line 13) | func hey() {
FILE: 03-packages-and-scopes/01-packages/main.go
function main (line 13) | func main() {
FILE: 03-packages-and-scopes/02-scopes/01-scopes/main.go
constant ok (line 15) | ok = true
function main (line 18) | func main() { // block scope starts
FILE: 03-packages-and-scopes/02-scopes/02-block-scope/main.go
function nope (line 11) | func nope() { // block scope starts
function main (line 20) | func main() { // block scope starts
FILE: 03-packages-and-scopes/02-scopes/03-nested-scope/main.go
function nested (line 19) | func nested() { // block scope starts
function main (line 30) | func main() { // block scope starts
FILE: 03-packages-and-scopes/02-scopes/04-package-scope/bye.go
function bye (line 13) | func bye() {
FILE: 03-packages-and-scopes/02-scopes/04-package-scope/hey.go
function hey (line 13) | func hey() {
FILE: 03-packages-and-scopes/02-scopes/04-package-scope/main.go
function main (line 13) | func main() {
FILE: 03-packages-and-scopes/03-importing/01-file-scope/main.go
function main (line 13) | func main() {
FILE: 03-packages-and-scopes/03-importing/02-renaming/main.go
function main (line 14) | func main() {
FILE: 03-packages-and-scopes/exercises/01-packages/main.go
function main (line 30) | func main() {
FILE: 03-packages-and-scopes/exercises/01-packages/solution/bye.go
function bye (line 13) | func bye() {
FILE: 03-packages-and-scopes/exercises/01-packages/solution/greet.go
function greet (line 13) | func greet() {
FILE: 03-packages-and-scopes/exercises/01-packages/solution/main.go
function main (line 11) | func main() {
FILE: 03-packages-and-scopes/exercises/02-scopes/main.go
function main (line 31) | func main() {
FILE: 03-packages-and-scopes/exercises/02-scopes/solution/main.go
function main (line 13) | func main() {
function bye (line 37) | func bye() {
FILE: 03-packages-and-scopes/exercises/02-scopes/solution/printer.go
function hello (line 13) | func hello() {
FILE: 03-packages-and-scopes/exercises/03-importing/main.go
function main (line 28) | func main() {
FILE: 03-packages-and-scopes/exercises/03-importing/solution/main.go
function main (line 15) | func main() {
FILE: 04-statements-expressions-comments/01-statements/01-execution-flow/main.go
function main (line 15) | func main() {
FILE: 04-statements-expressions-comments/01-statements/02-semicolons/main.go
function main (line 15) | func main() {
FILE: 04-statements-expressions-comments/02-expressions/01-operator/main.go
function main (line 15) | func main() {
FILE: 04-statements-expressions-comments/02-expressions/02-call-expression/main.go
function main (line 16) | func main() {
FILE: 04-statements-expressions-comments/03-comments/main.go
function main (line 20) | func main() {
FILE: 04-statements-expressions-comments/exercises/01-shy-semicolons/main.go
function main (line 21) | func main() {
FILE: 04-statements-expressions-comments/exercises/01-shy-semicolons/solution/main.go
function main (line 11) | func main() {
FILE: 04-statements-expressions-comments/exercises/02-naked-expression/main.go
function main (line 20) | func main() {
FILE: 04-statements-expressions-comments/exercises/02-naked-expression/solution/main.go
function main (line 11) | func main() {
FILE: 04-statements-expressions-comments/exercises/03-operators-combine/main.go
function main (line 24) | func main() {
FILE: 04-statements-expressions-comments/exercises/03-operators-combine/solution/main.go
function main (line 13) | func main() {
FILE: 04-statements-expressions-comments/exercises/04-print-go-version/main.go
function main (line 25) | func main() {
FILE: 04-statements-expressions-comments/exercises/04-print-go-version/solution/main.go
function main (line 16) | func main() {
FILE: 04-statements-expressions-comments/exercises/05-comment-out/main.go
function main (line 22) | func main() {
FILE: 04-statements-expressions-comments/exercises/05-comment-out/solution/main.go
function main (line 11) | func main() {
FILE: 05-write-your-first-library-package/exercise/solution/golang/cmd/main.go
function main (line 17) | func main() {
FILE: 05-write-your-first-library-package/exercise/solution/golang/go.go
function Version (line 16) | func Version() string {
FILE: 05-write-your-first-library-package/printer/cmd/main.go
function main (line 14) | func main() {
FILE: 05-write-your-first-library-package/printer/printer.go
function Hello (line 14) | func Hello() {
FILE: 06-variables/01-basic-data-types/exercises/01-print-the-literals/main.go
function main (line 26) | func main() {
FILE: 06-variables/01-basic-data-types/exercises/01-print-the-literals/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/01-basic-data-types/exercises/02-print-hexes/main.go
function main (line 45) | func main() {
FILE: 06-variables/01-basic-data-types/exercises/02-print-hexes/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/01-basic-data-types/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/01-declaration-syntax/01-syntax/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/01-declaration-syntax/02-naming-rules/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/01-declaration-syntax/03-order-of-declaration/main.go
function main (line 11) | func main() {
FILE: 06-variables/02-declarations/02-example-declarations/01-int/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/02-example-declarations/02-float64/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/02-example-declarations/03-bool/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/02-example-declarations/04-string/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/03-zero-values/main.go
function main (line 15) | func main() {
FILE: 06-variables/02-declarations/04-unused-variables-and-blank-identifier/01-unused-variable/main.go
function main (line 14) | func main() {
FILE: 06-variables/02-declarations/04-unused-variables-and-blank-identifier/02-blank-identifier/main.go
function main (line 11) | func main() {
FILE: 06-variables/02-declarations/05-multiple-declarations/01-multiple/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/05-multiple-declarations/02-parallel/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/06-examples/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/exercises/01-int/main.go
function main (line 22) | func main() {
FILE: 06-variables/02-declarations/exercises/01-int/solution/main.go
function main (line 15) | func main() {
FILE: 06-variables/02-declarations/exercises/02-bool/main.go
function main (line 22) | func main() {
FILE: 06-variables/02-declarations/exercises/02-bool/solution/main.go
function main (line 15) | func main() {
FILE: 06-variables/02-declarations/exercises/03-float64/main.go
function main (line 22) | func main() {
FILE: 06-variables/02-declarations/exercises/03-float64/solution/main.go
function main (line 15) | func main() {
FILE: 06-variables/02-declarations/exercises/04-string/main.go
function main (line 22) | func main() {
FILE: 06-variables/02-declarations/exercises/04-string/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/exercises/05-undeclarables/main.go
function main (line 28) | func main() {
FILE: 06-variables/02-declarations/exercises/05-undeclarables/solution/main.go
function main (line 11) | func main() {
FILE: 06-variables/02-declarations/exercises/06-with-bits/main.go
function main (line 39) | func main() {
FILE: 06-variables/02-declarations/exercises/06-with-bits/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/exercises/07-multiple/main.go
function main (line 29) | func main() {
FILE: 06-variables/02-declarations/exercises/07-multiple/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/exercises/08-multiple-2/main.go
function main (line 28) | func main() {
FILE: 06-variables/02-declarations/exercises/08-multiple-2/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/exercises/09-unused/main.go
function main (line 24) | func main() {
FILE: 06-variables/02-declarations/exercises/09-unused/solution/main.go
function main (line 11) | func main() {
FILE: 06-variables/02-declarations/exercises/10-package-variable/main.go
function main (line 20) | func main() {
FILE: 06-variables/02-declarations/exercises/10-package-variable/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/02-declarations/exercises/11-wrong-doer/main.go
function main (line 22) | func main() {
FILE: 06-variables/02-declarations/exercises/11-wrong-doer/solution/main.go
function main (line 11) | func main() {
FILE: 06-variables/03-short-declaration/01-initialization-and-short-declaration/01-initialization/main.go
function main (line 13) | func main() {
FILE: 06-variables/03-short-declaration/01-initialization-and-short-declaration/02-short-declaration/main.go
function main (line 13) | func main() {
FILE: 06-variables/03-short-declaration/01-initialization-and-short-declaration/03-coding-example/main.go
function main (line 13) | func main() {
FILE: 06-variables/03-short-declaration/02-package-scope/main.go
function main (line 26) | func main() {
FILE: 06-variables/03-short-declaration/03-multiple-short-declaration/01-declaration/main.go
function main (line 13) | func main() {
FILE: 06-variables/03-short-declaration/03-multiple-short-declaration/02-coding-example/main.go
function main (line 13) | func main() {
FILE: 06-variables/03-short-declaration/03-multiple-short-declaration/03-redeclaration/01/main.go
function main (line 13) | func main() {
FILE: 06-variables/03-short-declaration/03-multiple-short-declaration/03-redeclaration/02-coding-example/main.go
function main (line 13) | func main() {
FILE: 06-variables/03-short-declaration/04-short-vs-normal/01-declaration/main.go
function main (line 20) | func main() {
FILE: 06-variables/03-short-declaration/04-short-vs-normal/02-short-declaration/main.go
function main (line 13) | func main() {
FILE: 06-variables/03-short-declaration/exercises/01-short-declare/main.go
function main (line 21) | func main() {
FILE: 06-variables/03-short-declaration/exercises/01-short-declare/solution/main.go
function main (line 15) | func main() {
FILE: 06-variables/03-short-declaration/exercises/02-multiple-short-declare/main.go
function main (line 20) | func main() {
FILE: 06-variables/03-short-declaration/exercises/02-multiple-short-declare/solution/main.go
function main (line 15) | func main() {
FILE: 06-variables/03-short-declaration/exercises/03-multiple-short-declare-2/main.go
function main (line 23) | func main() {
FILE: 06-variables/03-short-declaration/exercises/03-multiple-short-declare-2/solution/main.go
function main (line 15) | func main() {
FILE: 06-variables/03-short-declaration/exercises/04-short-with-expression/main.go
function main (line 22) | func main() {
FILE: 06-variables/03-short-declaration/exercises/04-short-with-expression/solution/main.go
function main (line 15) | func main() {
FILE: 06-variables/03-short-declaration/exercises/05-short-discard/main.go
function main (line 29) | func main() {
FILE: 06-variables/03-short-declaration/exercises/05-short-discard/solution/main.go
function main (line 15) | func main() {
FILE: 06-variables/03-short-declaration/exercises/06-redeclare/main.go
function main (line 28) | func main() {
FILE: 06-variables/03-short-declaration/exercises/06-redeclare/solution/main.go
function main (line 15) | func main() {
FILE: 06-variables/04-assignment/01-assignment/01-assignment/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/01-assignment/02-strongly-typed/main.go
function main (line 19) | func main() {
FILE: 06-variables/04-assignment/01-assignment/03-examples/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/01-overview/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/05-multiple-assignment/main.go
function main (line 16) | func main() {
FILE: 06-variables/04-assignment/06-swapping/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/07-path-project/main.go
function main (line 16) | func main() {
FILE: 06-variables/04-assignment/08-path-project-discarding/main.go
function main (line 16) | func main() {
FILE: 06-variables/04-assignment/09-path-project-shortdecl/main.go
function main (line 16) | func main() {
FILE: 06-variables/04-assignment/exercises/01-make-it-blue/main.go
function main (line 22) | func main() {
FILE: 06-variables/04-assignment/exercises/01-make-it-blue/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/exercises/02-vars-to-vars/main.go
function main (line 38) | func main() {
FILE: 06-variables/04-assignment/exercises/02-vars-to-vars/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/exercises/03-assign-with-expressions/main.go
function main (line 28) | func main() {
FILE: 06-variables/04-assignment/exercises/03-assign-with-expressions/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/main.go
function main (line 33) | func main() {
FILE: 06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/exercises/05-multi-assign/main.go
function main (line 26) | func main() {
FILE: 06-variables/04-assignment/exercises/05-multi-assign/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/exercises/06-multi-assign-2/main.go
function main (line 28) | func main() {
FILE: 06-variables/04-assignment/exercises/06-multi-assign-2/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/exercises/07-multi-short-func/main.go
function main (line 30) | func main() {
function multi (line 40) | func multi() (int, int) {
FILE: 06-variables/04-assignment/exercises/07-multi-short-func/solution/main.go
function main (line 15) | func main() {
function multi (line 21) | func multi() (int, int) {
FILE: 06-variables/04-assignment/exercises/08-swapper/main.go
function main (line 25) | func main() {
FILE: 06-variables/04-assignment/exercises/08-swapper/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/exercises/09-swapper-2/main.go
function main (line 22) | func main() {
FILE: 06-variables/04-assignment/exercises/09-swapper-2/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/04-assignment/exercises/10-discard-the-file/main.go
function main (line 25) | func main() {
FILE: 06-variables/04-assignment/exercises/10-discard-the-file/solution/main.go
function main (line 16) | func main() {
FILE: 06-variables/05-type-conversion/01-destructive/main.go
function main (line 13) | func main() {
FILE: 06-variables/05-type-conversion/02-correct/main.go
function main (line 15) | func main() {
FILE: 06-variables/05-type-conversion/03-numeric-conversion/main.go
function main (line 13) | func main() {
FILE: 06-variables/05-type-conversion/exercises/01-convert-and-fix/main.go
function main (line 20) | func main() {
FILE: 06-variables/05-type-conversion/exercises/01-convert-and-fix/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/05-type-conversion/exercises/02-convert-and-fix-2/main.go
function main (line 20) | func main() {
FILE: 06-variables/05-type-conversion/exercises/02-convert-and-fix-2/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/05-type-conversion/exercises/03-convert-and-fix-3/main.go
function main (line 20) | func main() {
FILE: 06-variables/05-type-conversion/exercises/03-convert-and-fix-3/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/05-type-conversion/exercises/04-convert-and-fix-4/main.go
function main (line 20) | func main() {
FILE: 06-variables/05-type-conversion/exercises/04-convert-and-fix-4/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/05-type-conversion/exercises/05-convert-and-fix-5/main.go
function main (line 26) | func main() {
FILE: 06-variables/05-type-conversion/exercises/05-convert-and-fix-5/solution/main.go
function main (line 13) | func main() {
FILE: 06-variables/06-project-greeter/01-demonstration/main.go
function main (line 19) | func main() {
FILE: 06-variables/06-project-greeter/02-version1/main.go
function main (line 23) | func main() {
FILE: 06-variables/06-project-greeter/03-version2/main.go
function main (line 23) | func main() {
FILE: 06-variables/06-project-greeter/exercises/01-count-arguments/main.go
function main (line 23) | func main() {
FILE: 06-variables/06-project-greeter/exercises/01-count-arguments/solution/main.go
function main (line 16) | func main() {
FILE: 06-variables/06-project-greeter/exercises/02-print-the-path/main.go
function main (line 25) | func main() {
FILE: 06-variables/06-project-greeter/exercises/02-print-the-path/solution/main.go
function main (line 27) | func main() {
FILE: 06-variables/06-project-greeter/exercises/03-print-your-name/main.go
function main (line 34) | func main() {
FILE: 06-variables/06-project-greeter/exercises/03-print-your-name/solution/main.go
function main (line 16) | func main() {
FILE: 06-variables/06-project-greeter/exercises/04-greet-more-people/main.go
function main (line 30) | func main() {
FILE: 06-variables/06-project-greeter/exercises/04-greet-more-people/solution/main.go
function main (line 16) | func main() {
FILE: 06-variables/06-project-greeter/exercises/05-greet-5-people/main.go
function main (line 34) | func main() {
FILE: 06-variables/06-project-greeter/exercises/05-greet-5-people/solution/main.go
function main (line 16) | func main() {
FILE: 06-variables/06-project-greeter/exercises/solution-to-the-lecture-exercise/main.go
function main (line 24) | func main() {
FILE: 07-printf/01-intro/01-println-vs-printf/main.go
function main (line 13) | func main() {
FILE: 07-printf/01-intro/02/main.go
function main (line 13) | func main() {
FILE: 07-printf/02-escape-sequences/main.go
function main (line 13) | func main() {
FILE: 07-printf/03-printing-types/main.go
function main (line 13) | func main() {
FILE: 07-printf/04-coding/main.go
function main (line 13) | func main() {
FILE: 07-printf/exercises/01-print-your-age/main.go
function main (line 23) | func main() {
FILE: 07-printf/exercises/01-print-your-age/solution/main.go
function main (line 13) | func main() {
FILE: 07-printf/exercises/02-print-your-name-and-lastname/main.go
function main (line 25) | func main() {
FILE: 07-printf/exercises/02-print-your-name-and-lastname/solution/main.go
function main (line 13) | func main() {
FILE: 07-printf/exercises/03-false-claims/main.go
function main (line 20) | func main() {
FILE: 07-printf/exercises/03-false-claims/solution/main.go
function main (line 13) | func main() {
FILE: 07-printf/exercises/04-print-the-temperature/main.go
function main (line 24) | func main() {
FILE: 07-printf/exercises/04-print-the-temperature/solution/main.go
function main (line 13) | func main() {
FILE: 07-printf/exercises/05-double-quotes/main.go
function main (line 24) | func main() {
FILE: 07-printf/exercises/05-double-quotes/solution/main.go
function main (line 13) | func main() {
FILE: 07-printf/exercises/06-print-the-type/main.go
function main (line 20) | func main() {
FILE: 07-printf/exercises/06-print-the-type/solution/main.go
function main (line 13) | func main() {
FILE: 07-printf/exercises/07-print-the-type-2/main.go
function main (line 20) | func main() {
FILE: 07-printf/exercises/07-print-the-type-2/solution/main.go
function main (line 13) | func main() {
FILE: 07-printf/exercises/08-print-the-type-3/main.go
function main (line 20) | func main() {
FILE: 07-printf/exercises/08-print-the-type-3/solution/main.go
function main (line 13) | func main() {
FILE: 07-printf/exercises/09-print-the-type-4/main.go
function main (line 19) | func main() {
FILE: 07-printf/exercises/09-print-the-type-4/solution/main.go
function main (line 13) | func main() {
FILE: 07-printf/exercises/10-print-your-fullname/main.go
function main (line 24) | func main() {
FILE: 07-printf/exercises/10-print-your-fullname/solution/main.go
function main (line 16) | func main() {
FILE: 08-numbers-and-strings/01-numbers/01-arithmetic-operators/01/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/01-arithmetic-operators/02/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/01-arithmetic-operators/03-float-inaccuracy/01/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/01-arithmetic-operators/03-float-inaccuracy/02/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/01-arithmetic-operators/03-float-inaccuracy/03/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/02-arithmetic-operators-examples/01/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/02-arithmetic-operators-examples/02/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/03-precedence/01/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/03-precedence/02/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/03-precedence/03/main.go
function main (line 11) | func main() {
FILE: 08-numbers-and-strings/01-numbers/03-precedence/04/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/04-incdec-statement/01/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/04-incdec-statement/02/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/04-incdec-statement/03/main.go
function main (line 15) | func main() {
FILE: 08-numbers-and-strings/01-numbers/05-assignment-operations/main.go
function main (line 15) | func main() {
FILE: 08-numbers-and-strings/01-numbers/06-project-feet-to-meters/exercise-solution/main.go
function main (line 17) | func main() {
FILE: 08-numbers-and-strings/01-numbers/06-project-feet-to-meters/main.go
function main (line 17) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/01-do-some-calculations/main.go
function main (line 30) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/01-do-some-calculations/solution/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/02-fix-the-float/main.go
function main (line 22) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/02-fix-the-float/solution/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/03-precedence/main.go
function main (line 22) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/03-precedence/solution/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/04-incdecs/main.go
function main (line 25) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/04-incdecs/solution/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/05-manipulate-a-counter/main.go
function main (line 35) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/05-manipulate-a-counter/solution/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/06-simplify-the-assignments/main.go
function main (line 25) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/06-simplify-the-assignments/solution/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/07-circle-area/main.go
function main (line 39) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/07-circle-area/solution/main.go
function main (line 16) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/08-sphere-area/main.go
function main (line 39) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/08-sphere-area/solution/main.go
function main (line 18) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/09-sphere-volume/main.go
function main (line 36) | func main() {
FILE: 08-numbers-and-strings/01-numbers/exercises/09-sphere-volume/solution/main.go
function main (line 18) | func main() {
FILE: 08-numbers-and-strings/02-strings/01-raw-string-literal/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/02-strings/02-concatenation/01/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/02-strings/02-concatenation/02-assignment-operation/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/02-strings/02-concatenation/03-concat-non-strings/main.go
function main (line 16) | func main() {
FILE: 08-numbers-and-strings/02-strings/03-string-length/01-len/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/02-strings/03-string-length/02-unicode-len/main.go
function main (line 16) | func main() {
FILE: 08-numbers-and-strings/02-strings/04-project-banger/exercise-solution/main.go
function main (line 18) | func main() {
FILE: 08-numbers-and-strings/02-strings/04-project-banger/main.go
function main (line 19) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/01-windows-path/main.go
function main (line 28) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/01-windows-path/solution/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/02-print-json/main.go
function main (line 28) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/02-print-json/solution/main.go
function main (line 13) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/03-raw-concat/main.go
function main (line 35) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/03-raw-concat/solution/main.go
function main (line 16) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/04-count-the-chars/main.go
function main (line 29) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/04-count-the-chars/solution/main.go
function main (line 17) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/05-improved-banger/main.go
function main (line 30) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/05-improved-banger/solution/main.go
function main (line 18) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/06-tolowercase/main.go
function main (line 30) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/06-tolowercase/solution/main.go
function main (line 17) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/07-trim-it/main.go
function main (line 28) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/07-trim-it/solution/main.go
function main (line 16) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/08-right-trim-it/main.go
function main (line 31) | func main() {
FILE: 08-numbers-and-strings/02-strings/exercises/08-right-trim-it/solution/main.go
function main (line 17) | func main() {
FILE: 09-go-type-system/01-bits/main.go
function main (line 16) | func main() {
FILE: 09-go-type-system/02-bytes/main.go
function main (line 13) | func main() {
FILE: 09-go-type-system/03-predeclared-types/main.go
function main (line 17) | func main() {
FILE: 09-go-type-system/04-overflow/01-problem/main.go
function main (line 13) | func main() {
FILE: 09-go-type-system/04-overflow/02-explain/main.go
function main (line 16) | func main() {
FILE: 09-go-type-system/04-overflow/03-destructive/main.go
function main (line 13) | func main() {
FILE: 09-go-type-system/05-defined-types/01-duration-example/main.go
function main (line 16) | func main() {
FILE: 09-go-type-system/05-defined-types/02-type-definition-create-your-own-type/main.go
type gram (line 20) | type gram
type ounce (line 21) | type ounce
function main (line 28) | func main() {
FILE: 09-go-type-system/05-defined-types/03-underlying-types/main.go
type Gram (line 19) | type Gram
type Kilogram (line 22) | type Kilogram
type Ton (line 25) | type Ton
function main (line 28) | func main() {
FILE: 09-go-type-system/05-defined-types/03-underlying-types/weights/weights.go
type Gram (line 13) | type Gram
type Kilogram (line 16) | type Kilogram
type Ton (line 19) | type Ton
FILE: 09-go-type-system/06-aliased-types/main.go
function main (line 11) | func main() {
FILE: 09-go-type-system/exercises/01-optimal-types/main.go
function main (line 29) | func main() {
FILE: 09-go-type-system/exercises/01-optimal-types/solution/main.go
function main (line 13) | func main() {
FILE: 09-go-type-system/exercises/02-the-type-problem/main.go
function main (line 25) | func main() {
FILE: 09-go-type-system/exercises/02-the-type-problem/solution/main.go
function main (line 13) | func main() {
FILE: 09-go-type-system/exercises/03-parse-arg-numbers/main.go
function main (line 45) | func main() {
FILE: 09-go-type-system/exercises/03-parse-arg-numbers/solution/main.go
function main (line 17) | func main() {
FILE: 09-go-type-system/exercises/04-time-multiplier/main.go
function main (line 43) | func main() {
FILE: 09-go-type-system/exercises/04-time-multiplier/solution/main.go
function main (line 18) | func main() {
FILE: 09-go-type-system/exercises/05-refactor-feet-to-meter/main.go
function main (line 21) | func main() {
FILE: 09-go-type-system/exercises/05-refactor-feet-to-meter/solution/main.go
function main (line 17) | func main() {
FILE: 09-go-type-system/exercises/06-convert-the-types/main.go
function main (line 22) | func main() {
FILE: 09-go-type-system/exercises/06-convert-the-types/solution/main.go
function main (line 13) | func main() {
FILE: 10-constants/01-declarations/01-syntax/01-magic-numbers/main.go
function main (line 15) | func main() {
FILE: 10-constants/01-declarations/01-syntax/02-constants/main.go
function main (line 16) | func main() {
FILE: 10-constants/01-declarations/01-syntax/03-safety/main.go
function main (line 13) | func main() {
FILE: 10-constants/01-declarations/01-syntax/04-rules/01-immutability/main.go
function main (line 11) | func main() {
FILE: 10-constants/01-declarations/01-syntax/04-rules/02-runtime-func/main.go
function main (line 16) | func main() {
FILE: 10-constants/01-declarations/01-syntax/04-rules/03-runtime-var/main.go
function main (line 11) | func main() {
FILE: 10-constants/01-declarations/01-syntax/04-rules/04-len/main.go
function main (line 13) | func main() {
FILE: 10-constants/01-declarations/02-constant-types-and-expressions/01/main.go
function main (line 13) | func main() {
FILE: 10-constants/01-declarations/02-constant-types-and-expressions/02/main.go
function main (line 13) | func main() {
FILE: 10-constants/01-declarations/02-constant-types-and-expressions/03/main.go
function main (line 13) | func main() {
FILE: 10-constants/01-declarations/03-multiple-declaration/01/main.go
function main (line 13) | func main() {
FILE: 10-constants/01-declarations/03-multiple-declaration/02/main.go
function main (line 13) | func main() {
FILE: 10-constants/01-declarations/03-multiple-declaration/03/main.go
function main (line 13) | func main() {
FILE: 10-constants/02-typeless-constants/01-typeless-constants/main.go
function main (line 13) | func main() {
FILE: 10-constants/02-typeless-constants/02-typed-vs-typeless/01/main.go
function main (line 13) | func main() {
FILE: 10-constants/02-typeless-constants/02-typed-vs-typeless/02/main.go
function main (line 13) | func main() {
FILE: 10-constants/02-typeless-constants/02-typed-vs-typeless/03/main.go
function main (line 13) | func main() {
FILE: 10-constants/02-typeless-constants/02-typed-vs-typeless/04/main.go
function main (line 13) | func main() {
FILE: 10-constants/02-typeless-constants/03-default-type/01/main.go
function main (line 13) | func main() {
FILE: 10-constants/02-typeless-constants/03-default-type/02/main.go
function main (line 13) | func main() {
FILE: 10-constants/02-typeless-constants/03-default-type/03/main.go
function main (line 13) | func main() {
FILE: 10-constants/02-typeless-constants/03-default-type/04/main.go
function main (line 13) | func main() {
FILE: 10-constants/02-typeless-constants/03-default-type/05/main.go
function main (line 11) | func main() {
FILE: 10-constants/02-typeless-constants/04-demo/01/main.go
function main (line 16) | func main() {
FILE: 10-constants/02-typeless-constants/04-demo/02/main.go
function main (line 16) | func main() {
FILE: 10-constants/03-refactor-feet-to-meters/main.go
function main (line 22) | func main() {
FILE: 10-constants/03-refactor-feet-to-meters/solution/main.go
function main (line 21) | func main() {
FILE: 10-constants/03-refactor-feet-to-meters/solution/without-comments/main.go
function main (line 21) | func main() {
FILE: 10-constants/04-iota/01-manually/main.go
function main (line 13) | func main() {
FILE: 10-constants/04-iota/02-with-iota/main.go
function main (line 13) | func main() {
FILE: 10-constants/04-iota/03-expressions/main.go
function main (line 13) | func main() {
FILE: 10-constants/04-iota/04-blank-identifier/01/main.go
function main (line 13) | func main() {
FILE: 10-constants/04-iota/04-blank-identifier/02/main.go
function main (line 13) | func main() {
FILE: 10-constants/04-iota/04-blank-identifier/03/main.go
function main (line 13) | func main() {
FILE: 10-constants/exercises/01-minutes-in-weeks/main.go
function main (line 30) | func main() {
FILE: 10-constants/exercises/01-minutes-in-weeks/solution/main.go
function main (line 13) | func main() {
FILE: 10-constants/exercises/02-remove-the-magic/main.go
function main (line 29) | func main() {
FILE: 10-constants/exercises/02-remove-the-magic/solution/main.go
function main (line 13) | func main() {
FILE: 10-constants/exercises/03-constant-length/main.go
function main (line 35) | func main() {
FILE: 10-constants/exercises/03-constant-length/solution/main.go
function main (line 13) | func main() {
FILE: 10-constants/exercises/04-tau/main.go
function main (line 23) | func main() {
FILE: 10-constants/exercises/04-tau/solution/main.go
function main (line 13) | func main() {
FILE: 10-constants/exercises/05-area/main.go
function main (line 23) | func main() {
FILE: 10-constants/exercises/05-area/solution/main.go
function main (line 13) | func main() {
FILE: 10-constants/exercises/06-no-conversions-allowed/main.go
function main (line 21) | func main() {
FILE: 10-constants/exercises/06-no-conversions-allowed/solution/main.go
function main (line 16) | func main() {
FILE: 10-constants/exercises/07-iota-months/main.go
function main (line 28) | func main() {
FILE: 10-constants/exercises/07-iota-months/solution/main.go
function main (line 13) | func main() {
FILE: 10-constants/exercises/08-iota-months-2/main.go
function main (line 23) | func main() {
FILE: 10-constants/exercises/08-iota-months-2/solution/main.go
function main (line 13) | func main() {
FILE: 10-constants/exercises/09-iota-seasons/main.go
function main (line 25) | func main() {
FILE: 10-constants/exercises/09-iota-seasons/solution/main.go
function main (line 13) | func main() {
FILE: 11-if/01-boolean-operators/01-comparison-operators/main.go
function main (line 13) | func main() {
FILE: 11-if/01-boolean-operators/02-comparison-and-assignability/01/main.go
function main (line 11) | func main() {
FILE: 11-if/01-boolean-operators/02-comparison-and-assignability/02/main.go
function main (line 11) | func main() {
FILE: 11-if/01-boolean-operators/02-comparison-and-assignability/03/main.go
function main (line 16) | func main() {
FILE: 11-if/01-boolean-operators/03-logical-operators/01-and-operator/01/main.go
function main (line 13) | func main() {
FILE: 11-if/01-boolean-operators/03-logical-operators/01-and-operator/02/main.go
function main (line 13) | func main() {
FILE: 11-if/01-boolean-operators/03-logical-operators/02-or-operator/01/main.go
function main (line 13) | func main() {
FILE: 11-if/01-boolean-operators/03-logical-operators/02-or-operator/02/main.go
function main (line 13) | func main() {
FILE: 11-if/01-boolean-operators/03-logical-operators/03-not-operator/01/main.go
function main (line 13) | func main() {
FILE: 11-if/01-boolean-operators/03-logical-operators/03-not-operator/02/main.go
function main (line 15) | func main() {
FILE: 11-if/02-if-statement/01-if-branch/main.go
function main (line 13) | func main() {
FILE: 11-if/02-if-statement/02-else-branch/main.go
function main (line 13) | func main() {
FILE: 11-if/02-if-statement/03-else-if-branch/01/main.go
function main (line 13) | func main() {
FILE: 11-if/02-if-statement/03-else-if-branch/02/main.go
function main (line 13) | func main() {
FILE: 11-if/02-if-statement/04-refactor-feet-to-meters/main.go
constant usage (line 18) | usage = `
function main (line 26) | func main() {
FILE: 11-if/02-if-statement/05-challenge-userpass/01-1st-challenge/01-challenge/main.go
function main (line 36) | func main() {
FILE: 11-if/02-if-statement/05-challenge-userpass/01-1st-challenge/02-solution/main.go
function main (line 16) | func main() {
FILE: 11-if/02-if-statement/05-challenge-userpass/01-1st-challenge/03-solution-refactor/main.go
constant usage (line 17) | usage = "Usage: [username] [password]"
constant errUser (line 18) | errUser = "Access denied for %q.\n"
constant errPwd (line 19) | errPwd = "Invalid password for %q.\n"
constant accessOK (line 20) | accessOK = "Access granted to %q.\n"
constant user (line 21) | user = "jack"
constant pass (line 22) | pass = "1888"
function main (line 25) | func main() {
FILE: 11-if/02-if-statement/05-challenge-userpass/02-2nd-challenge/01-challenge/main.go
constant usage (line 48) | usage = "Usage: [username] [password]"
constant errUser (line 49) | errUser = "Access denied for %q.\n"
constant errPwd (line 50) | errPwd = "Invalid password for %q.\n"
constant accessOK (line 51) | accessOK = "Access granted to %q.\n"
constant user (line 52) | user = "jack"
constant pass (line 53) | pass = "1888"
function main (line 56) | func main() {
FILE: 11-if/02-if-statement/05-challenge-userpass/02-2nd-challenge/02-solution/main.go
constant usage (line 17) | usage = "Usage: [username] [password]"
constant errUser (line 18) | errUser = "Access denied for %q.\n"
constant errPwd (line 19) | errPwd = "Invalid password for %q.\n"
constant accessOK (line 20) | accessOK = "Access granted to %q.\n"
constant user (line 21) | user, user2 = "jack", "inanc"
constant pass (line 22) | pass, pass2 = "1888", "1879"
function main (line 25) | func main() {
FILE: 11-if/03-error-handling/01-itoa/main.go
function main (line 16) | func main() {
FILE: 11-if/03-error-handling/02-atoi/main.go
function main (line 17) | func main() {
FILE: 11-if/03-error-handling/03-atoi-error-handling/main.go
function main (line 17) | func main() {
FILE: 11-if/03-error-handling/04-challenge-feet-to-meters/01-challenge/main.go
constant usage (line 33) | usage = `
function main (line 41) | func main() {
FILE: 11-if/03-error-handling/04-challenge-feet-to-meters/02-solution/main.go
constant usage (line 18) | usage = `
function main (line 26) | func main() {
FILE: 11-if/04-short-if/01-without-short-if/main.go
function main (line 16) | func main() {
FILE: 11-if/04-short-if/02-with-short-if/main.go
function main (line 16) | func main() {
FILE: 11-if/04-short-if/03-scope/main.go
function main (line 17) | func main() {
FILE: 11-if/04-short-if/04-scope-shadowing/01-shadowing/main.go
function main (line 17) | func main() {
FILE: 11-if/04-short-if/04-scope-shadowing/02-shadowing-solution/main.go
function main (line 17) | func main() {
FILE: 11-if/exercises/01-age-seasons/main.go
function main (line 30) | func main() {
FILE: 11-if/exercises/01-age-seasons/solution/main.go
function main (line 13) | func main() {
FILE: 11-if/exercises/02-simplify-it/main.go
function main (line 30) | func main() {
FILE: 11-if/exercises/02-simplify-it/solution/main.go
function main (line 13) | func main() {
FILE: 11-if/exercises/03-arg-count/main.go
function main (line 32) | func main() {
FILE: 11-if/exercises/03-arg-count/solution/main.go
function main (line 16) | func main() {
FILE: 11-if/exercises/04-vowel-or-cons/main.go
function main (line 52) | func main() {
FILE: 11-if/exercises/04-vowel-or-cons/solution/main.go
function main (line 16) | func main() {
FILE: 11-if/exercises/04-vowel-or-cons/solution2/main.go
function main (line 17) | func main() {
FILE: 11-if/exercises/05-movie-ratings/main.go
function main (line 55) | func main() {
FILE: 11-if/exercises/05-movie-ratings/solution/main.go
function main (line 17) | func main() {
FILE: 11-if/exercises/05-movie-ratings/solution2/main.go
function main (line 21) | func main() {
FILE: 11-if/exercises/06-odd-even/main.go
function main (line 39) | func main() {
FILE: 11-if/exercises/06-odd-even/solution/main.go
function main (line 17) | func main() {
FILE: 11-if/exercises/07-leap-year/main.go
function main (line 39) | func main() {
FILE: 11-if/exercises/07-leap-year/solution/main.go
function main (line 17) | func main() {
FILE: 11-if/exercises/08-simplify-leap-year/main.go
function main (line 22) | func main() {
FILE: 11-if/exercises/08-simplify-leap-year/solution/main.go
function main (line 17) | func main() {
FILE: 11-if/exercises/09-days-in-month/main.go
function main (line 90) | func main() {
FILE: 11-if/exercises/09-days-in-month/solution/main.go
function main (line 18) | func main() {
FILE: 12-switch/01-one-case/main.go
function main (line 13) | func main() {
FILE: 12-switch/02-multiple-cases/main.go
function main (line 16) | func main() {
FILE: 12-switch/03-default-clause/main.go
function main (line 16) | func main() {
FILE: 12-switch/04-multiple-conditions/main.go
function main (line 16) | func main() {
FILE: 12-switch/05-bool-expressions/main.go
function main (line 13) | func main() {
FILE: 12-switch/06-fallthrough/01-without/main.go
function main (line 13) | func main() {
FILE: 12-switch/06-fallthrough/02-with/main.go
function main (line 13) | func main() {
FILE: 12-switch/07-short-switch/main.go
function main (line 13) | func main() {
FILE: 12-switch/08-parts-of-the-day/main.go
function main (line 16) | func main() {
FILE: 12-switch/09-when-to-use/main.go
function main (line 16) | func main() {
FILE: 12-switch/exercises/01-richter-scale/main.go
function main (line 73) | func main() {
FILE: 12-switch/exercises/01-richter-scale/solution/main.go
function main (line 17) | func main() {
FILE: 12-switch/exercises/02-richter-scale-2/main.go
function main (line 69) | func main() {
FILE: 12-switch/exercises/02-richter-scale-2/solution/main.go
function main (line 16) | func main() {
FILE: 12-switch/exercises/03-convert/main.go
constant usage (line 23) | usage = "Usage: [username] [password]"
constant errUser (line 24) | errUser = "Access denied for %q.\n"
constant errPwd (line 25) | errPwd = "Invalid password for %q.\n"
constant accessOK (line 26) | accessOK = "Access granted to %q.\n"
constant user (line 27) | user, user2 = "jack", "inanc"
constant pass (line 28) | pass, pass2 = "1888", "1879"
function main (line 31) | func main() {
FILE: 12-switch/exercises/03-convert/solution/main.go
constant usage (line 17) | usage = "Usage: [username] [password]"
constant errUser (line 18) | errUser = "Access denied for %q.\n"
constant errPwd (line 19) | errPwd = "Invalid password for %q.\n"
constant accessOK (line 20) | accessOK = "Access granted to %q.\n"
constant user (line 21) | user, user2 = "jack", "inanc"
constant pass (line 22) | pass, pass2 = "1888", "1879"
function main (line 25) | func main() {
FILE: 12-switch/exercises/04-string-manipulator/main.go
function main (line 46) | func main() {
FILE: 12-switch/exercises/04-string-manipulator/solution/main.go
constant usage (line 17) | usage = `[command] [string]
function main (line 21) | func main() {
FILE: 12-switch/exercises/05-days-in-month/main.go
function main (line 29) | func main() {
FILE: 12-switch/exercises/05-days-in-month/solution/main.go
function main (line 18) | func main() {
FILE: 13-loops/01-basics/main.go
function main (line 15) | func main() {
FILE: 13-loops/02-break/main.go
function main (line 15) | func main() {
FILE: 13-loops/03-continue/01-a-before/main.go
function main (line 15) | func main() {
FILE: 13-loops/03-continue/01-b-after/main.go
function main (line 15) | func main() {
FILE: 13-loops/04-nested-loops-multiplication-table/main.go
constant max (line 18) | max = 5
function main (line 20) | func main() {
FILE: 13-loops/05-for-range/01-loop-over-slices/main.go
function main (line 16) | func main() {
FILE: 13-loops/05-for-range/02-loop-over-words/main.go
function main (line 16) | func main() {
FILE: 13-loops/06-project-lucky-number-game/01-randomization/main.go
function main (line 17) | func main() {
FILE: 13-loops/06-project-lucky-number-game/02-game/main.go
constant maxTurns (line 20) | maxTurns = 5
constant usage (line 21) | usage = `Welcome to the Lucky Number Game! 🍀
function main (line 32) | func main() {
FILE: 13-loops/07-project-word-finder/main.go
constant corpus (line 17) | corpus = "lazy cat jumps again and again and again"
function main (line 19) | func main() {
FILE: 13-loops/08-word-finder-labeled-break/main.go
constant corpus (line 17) | corpus = "lazy cat jumps again and again and again"
function main (line 19) | func main() {
FILE: 13-loops/09-word-finder-labeled-continue/main.go
constant corpus (line 17) | corpus = "lazy cat jumps again and again and again"
function main (line 19) | func main() {
FILE: 13-loops/10-word-finder-labeled-switch/main.go
constant corpus (line 17) | corpus = "lazy cat jumps again and again and again"
function main (line 19) | func main() {
FILE: 13-loops/11-goto/main.go
function main (line 15) | func main() {
FILE: 13-loops/exercises/01-sum-the-numbers/main.go
function main (line 21) | func main() {
FILE: 13-loops/exercises/01-sum-the-numbers/solution/main.go
function main (line 15) | func main() {
FILE: 13-loops/exercises/02-sum-the-numbers-verbose/main.go
function main (line 28) | func main() {
FILE: 13-loops/exercises/02-sum-the-numbers-verbose/solution/main.go
function main (line 15) | func main() {
FILE: 13-loops/exercises/03-sum-up-to-n/main.go
function main (line 38) | func main() {
FILE: 13-loops/exercises/03-sum-up-to-n/solution/main.go
function main (line 17) | func main() {
FILE: 13-loops/exercises/04-only-evens/main.go
function main (line 30) | func main() {
FILE: 13-loops/exercises/04-only-evens/solution/main.go
function main (line 17) | func main() {
FILE: 13-loops/exercises/05-break-up/main.go
function main (line 30) | func main() {
FILE: 13-loops/exercises/05-break-up/solution/main.go
function main (line 17) | func main() {
FILE: 13-loops/exercises/06-infinite-kill/main.go
function main (line 55) | func main() {
FILE: 13-loops/exercises/06-infinite-kill/solution/main.go
function main (line 17) | func main() {
FILE: 13-loops/exercises/07-multiplication-table-exercises/01-dynamic-table/main.go
function main (line 56) | func main() {
FILE: 13-loops/exercises/07-multiplication-table-exercises/01-dynamic-table/solution/main.go
function main (line 17) | func main() {
FILE: 13-loops/exercises/07-multiplication-table-exercises/02-math-tables/main.go
function main (line 107) | func main() {
FILE: 13-loops/exercises/07-multiplication-table-exercises/02-math-tables/solution/main.go
constant validOps (line 19) | validOps = "%*/+-"
constant usageMsg (line 21) | usageMsg = "Usage: [op=" + validOps + "] [size]"
constant sizeMissingMsg (line 22) | sizeMissingMsg = "Size is missing"
constant invalidOpMsg (line 23) | invalidOpMsg = `Invalid operator.
constant invalidOp (line 26) | invalidOp = -1
function main (line 29) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/01-first-turn-winner/main.go
function main (line 28) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/01-first-turn-winner/solution-better/main.go
constant maxTurns (line 20) | maxTurns = 5
constant usage (line 21) | usage = `Welcome to the Lucky Number Game! 🍀
function main (line 32) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/01-first-turn-winner/solution/main.go
constant maxTurns (line 20) | maxTurns = 5
constant usage (line 21) | usage = `Welcome to the Lucky Number Game! 🍀
function main (line 32) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/02-random-messages/main.go
function main (line 37) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/02-random-messages/solution/main.go
constant maxTurns (line 20) | maxTurns = 5
constant usage (line 21) | usage = `Welcome to the Lucky Number Game! 🍀
function main (line 32) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/03-double-guesses/main.go
function main (line 25) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/03-double-guesses/solution/main.go
constant maxTurns (line 20) | maxTurns = 5
constant usage (line 21) | usage = `Welcome to the Lucky Number Game! 🍀
function main (line 32) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/04-verbose-mode/main.go
function main (line 29) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/04-verbose-mode/solution/main.go
constant maxTurns (line 20) | maxTurns = 5
constant usage (line 21) | usage = `Welcome to the Lucky Number Game! 🍀
function main (line 34) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/05-enough-picks/main.go
function main (line 48) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/05-enough-picks/solution/main.go
constant maxTurns (line 20) | maxTurns = 5
constant usage (line 21) | usage = `Welcome to the Lucky Number Game! 🍀
function main (line 32) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/06-dynamic-difficulty/main.go
function main (line 51) | func main() {
FILE: 13-loops/exercises/08-lucky-number-exercises/06-dynamic-difficulty/solution/main.go
constant maxTurns (line 20) | maxTurns = 5
constant usage (line 21) | usage = `Welcome to the Lucky Number Game! 🍀
function main (line 32) | func main() {
FILE: 13-loops/exercises/09-word-finder-exercises/01-case-insensitive/main.go
function main (line 27) | func main() {
FILE: 13-loops/exercises/09-word-finder-exercises/01-case-insensitive/solution/main.go
constant corpus (line 17) | corpus = "lazy cat jumps again and again and again"
function main (line 19) | func main() {
FILE: 13-loops/exercises/09-word-finder-exercises/02-path-searcher/main.go
function main (line 82) | func main() {
FILE: 13-loops/exercises/09-word-finder-exercises/02-path-searcher/solution/main.go
function main (line 18) | func main() {
FILE: 13-loops/exercises/10-crunch-the-primes/main.go
function main (line 36) | func main() {
FILE: 13-loops/exercises/10-crunch-the-primes/solution/main.go
function main (line 17) | func main() {
FILE: 14-arrays/01-whats-an-array/main.go
function main (line 13) | func main() {
FILE: 14-arrays/02-examples-1-hipsters-love-bookstore/main.go
constant winter (line 22) | winter = 1
constant summer (line 23) | summer = 3
constant yearly (line 24) | yearly = winter + summer
function main (line 27) | func main() {
FILE: 14-arrays/03-examples-2-hipsters-love-bookstore/main.go
constant winter (line 22) | winter = 1
constant summer (line 23) | summer = 3
constant yearly (line 24) | yearly = winter + summer
function main (line 27) | func main() {
FILE: 14-arrays/04-array-literal/main.go
function main (line 21) | func main() {
FILE: 14-arrays/05-examples-3-hipsters-love-bookstore/main.go
constant winter (line 22) | winter = 1
constant summer (line 23) | summer = 3
constant yearly (line 24) | yearly = winter + summer
function main (line 27) | func main() {
FILE: 14-arrays/06-challenge-moodly/challenge/main.go
function main (line 48) | func main() {
FILE: 14-arrays/06-challenge-moodly/solution/main.go
function main (line 18) | func main() {
FILE: 14-arrays/07-compare/main.go
function main (line 17) | func main() {
FILE: 14-arrays/08-assignment/01/main.go
function main (line 13) | func main() {
FILE: 14-arrays/08-assignment/02-example/main.go
function main (line 13) | func main() {
FILE: 14-arrays/09-multi-dimensional/main.go
function main (line 13) | func main() {
FILE: 14-arrays/10-challenge-moodly-2/challenge/main.go
function main (line 61) | func main() {
FILE: 14-arrays/10-challenge-moodly-2/solution/main.go
function main (line 18) | func main() {
FILE: 14-arrays/11-keyed-elements/01-unkeyed/main.go
function main (line 13) | func main() {
FILE: 14-arrays/11-keyed-elements/02-keyed/main.go
function main (line 13) | func main() {
FILE: 14-arrays/11-keyed-elements/03-keyed-order/main.go
function main (line 13) | func main() {
FILE: 14-arrays/11-keyed-elements/04-keyed-auto-initialize/main.go
function main (line 13) | func main() {
FILE: 14-arrays/11-keyed-elements/05-keyed-auto-initialize-ellipsis/main.go
function main (line 13) | func main() {
FILE: 14-arrays/11-keyed-elements/06-keyed-and-unkeyed/main.go
function main (line 13) | func main() {
FILE: 14-arrays/11-keyed-elements/07-xratio-example/01-without-keys/main.go
function main (line 13) | func main() {
FILE: 14-arrays/11-keyed-elements/07-xratio-example/02-with-keys/main.go
function main (line 17) | func main() {
FILE: 14-arrays/12-compare-unnamed/main.go
function main (line 17) | func main() {
FILE: 14-arrays/exercises/01-declare-empty/main.go
function main (line 61) | func main() {
FILE: 14-arrays/exercises/01-declare-empty/solution/main.go
function main (line 13) | func main() {
FILE: 14-arrays/exercises/02-get-set-arrays/main.go
function main (line 125) | func main() {
FILE: 14-arrays/exercises/02-get-set-arrays/solution/main.go
function main (line 16) | func main() {
FILE: 14-arrays/exercises/03-array-literal/main.go
function main (line 27) | func main() {
FILE: 14-arrays/exercises/03-array-literal/solution/main.go
function main (line 16) | func main() {
FILE: 14-arrays/exercises/04-ellipsis/main.go
function main (line 25) | func main() {
FILE: 14-arrays/exercises/04-ellipsis/solution/main.go
function main (line 16) | func main() {
FILE: 14-arrays/exercises/05-fix/main.go
function main (line 21) | func main() {
FILE: 14-arrays/exercises/05-fix/solution/main.go
function main (line 13) | func main() {
FILE: 14-arrays/exercises/06-compare/main.go
function main (line 26) | func main() {
FILE: 14-arrays/exercises/06-compare/solution/main.go
function main (line 13) | func main() {
FILE: 14-arrays/exercises/07-assign/main.go
function main (line 44) | func main() {
FILE: 14-arrays/exercises/07-assign/solution/main.go
function main (line 16) | func main() {
FILE: 14-arrays/exercises/08-wizard-printer/main.go
function main (line 32) | func main() {
FILE: 14-arrays/exercises/08-wizard-printer/solution/main.go
function main (line 16) | func main() {
FILE: 14-arrays/exercises/09-currency-converter/main.go
function main (line 48) | func main() {
FILE: 14-arrays/exercises/09-currency-converter/solution/main.go
function main (line 17) | func main() {
FILE: 14-arrays/exercises/10-hipsters-love-search/main.go
function main (line 61) | func main() {
FILE: 14-arrays/exercises/10-hipsters-love-search/solution/main.go
function main (line 17) | func main() {
FILE: 14-arrays/exercises/11-average/main.go
function main (line 42) | func main() {
FILE: 14-arrays/exercises/11-average/solution/main.go
function main (line 17) | func main() {
FILE: 14-arrays/exercises/12-sorter/main.go
function main (line 49) | func main() {
FILE: 14-arrays/exercises/12-sorter/solution/main.go
function main (line 17) | func main() {
FILE: 14-arrays/exercises/13-word-finder/main.go
constant corpus (line 54) | corpus = "lazy cat jumps again and again and again since the beginning t...
function main (line 56) | func main() {
FILE: 14-arrays/exercises/13-word-finder/solution/main.go
constant corpus (line 17) | corpus = "lazy cat jumps again and again and again since the beginning t...
function main (line 19) | func main() {
FILE: 15-project-retro-led-clock/01-printing-the-digits/main.go
function main (line 11) | func main() {
FILE: 15-project-retro-led-clock/01-printing-the-digits/solution/main.go
function main (line 15) | func main() {
FILE: 15-project-retro-led-clock/02-printing-the-clock/main.go
function main (line 15) | func main() {
FILE: 15-project-retro-led-clock/02-printing-the-clock/solution/main.go
function main (line 16) | func main() {
FILE: 15-project-retro-led-clock/03-animating-the-clock/main.go
function main (line 16) | func main() {
FILE: 15-project-retro-led-clock/03-animating-the-clock/solution/main.go
function main (line 18) | func main() {
FILE: 15-project-retro-led-clock/04-blinking-the-separators/main.go
function main (line 18) | func main() {
FILE: 15-project-retro-led-clock/04-blinking-the-separators/solution/main.go
function main (line 18) | func main() {
FILE: 15-project-retro-led-clock/05-full-annotated-solution/main.go
function main (line 18) | func main() {
FILE: 15-project-retro-led-clock/exercises/01-refactor/main.go
function main (line 49) | func main() {
FILE: 15-project-retro-led-clock/exercises/01-refactor/solution/main.go
function main (line 18) | func main() {
FILE: 15-project-retro-led-clock/exercises/01-refactor/solution/placeholders.go
type placeholder (line 11) | type placeholder
FILE: 15-project-retro-led-clock/exercises/02-alarm/main.go
function main (line 57) | func main() {
FILE: 15-project-retro-led-clock/exercises/02-alarm/placeholders.go
type placeholder (line 11) | type placeholder
FILE: 15-project-retro-led-clock/exercises/02-alarm/solution/main.go
function main (line 18) | func main() {
FILE: 15-project-retro-led-clock/exercises/02-alarm/solution/placeholders.go
type placeholder (line 11) | type placeholder
FILE: 15-project-retro-led-clock/exercises/03-split-second/main.go
function main (line 117) | func main() {
FILE: 15-project-retro-led-clock/exercises/03-split-second/placeholders.go
type placeholder (line 11) | type placeholder
FILE: 15-project-retro-led-clock/exercises/03-split-second/solution/main.go
function main (line 18) | func main() {
FILE: 15-project-retro-led-clock/exercises/03-split-second/solution/placeholders.go
type placeholder (line 11) | type placeholder
FILE: 15-project-retro-led-clock/exercises/04-ticker/main.go
function main (line 84) | func main() {
FILE: 15-project-retro-led-clock/exercises/04-ticker/placeholders.go
type placeholder (line 11) | type placeholder
FILE: 15-project-retro-led-clock/exercises/04-ticker/solution/main.go
function main (line 18) | func main() {
FILE: 15-project-retro-led-clock/exercises/04-ticker/solution/placeholders.go
type placeholder (line 11) | type placeholder
FILE: 16-slices/01-slices-vs-arrays/main.go
function main (line 13) | func main() {
FILE: 16-slices/02-slices-vs-arrays/main.go
function main (line 13) | func main() {
FILE: 16-slices/03-slices-vs-arrays-examples/main.go
function main (line 16) | func main() {
FILE: 16-slices/04-slices-vs-arrays-unique-nums/01-with-arrays/main.go
function main (line 17) | func main() {
FILE: 16-slices/04-slices-vs-arrays-unique-nums/02-with-slices/main.go
function main (line 20) | func main() {
FILE: 16-slices/05-append/1-theory/main.go
function main (line 15) | func main() {
FILE: 16-slices/05-append/2-example/main.go
function main (line 15) | func main() {
FILE: 16-slices/06-slice-expressions/1-theory/main.go
function main (line 15) | func main() {
FILE: 16-slices/06-slice-expressions/2-example/main.go
function main (line 17) | func main() {
FILE: 16-slices/07-slice-expressions-pagination/main.go
function main (line 17) | func main() {
FILE: 16-slices/08-slice-internals-1-backing-array/1-theory/main.go
function main (line 13) | func main() {
FILE: 16-slices/08-slice-internals-1-backing-array/2-example/main.go
function main (line 15) | func main() {
FILE: 16-slices/09-slice-internals-2-slice-header/1-theory/main.go
function main (line 17) | func main() {
FILE: 16-slices/09-slice-internals-2-slice-header/2-example/main.go
type collection (line 19) | type collection
function main (line 25) | func main() {
function change (line 54) | func change(data collection) {
FILE: 16-slices/10-slice-internals-3-len-cap/1-theory/main.go
function main (line 17) | func main() {
FILE: 16-slices/10-slice-internals-3-len-cap/2-example/main.go
function main (line 15) | func main() {
FILE: 16-slices/11-slice-internals-4-append/1-theory/main.go
function main (line 15) | func main() {
FILE: 16-slices/11-slice-internals-4-append/2-example/main.go
function main (line 15) | func main() {
function init (line 52) | func init() {
FILE: 16-slices/11-slice-internals-4-append/3-example-growth/main.go
function main (line 19) | func main() {
FILE: 16-slices/11-slice-internals-4-append/4-example-growth/main.go
function main (line 15) | func main() {
FILE: 16-slices/12-full-slice-expressions/1-theory/main.go
function main (line 15) | func main() {
FILE: 16-slices/12-full-slice-expressions/2-example/main.go
function main (line 15) | func main() {
function init (line 33) | func init() {
FILE: 16-slices/13-make/1-theory/main.go
function main (line 15) | func main() {
FILE: 16-slices/13-make/2-example/main.go
function main (line 17) | func main() {
FILE: 16-slices/14-copy/01-usage/main.go
function main (line 17) | func main() {
FILE: 16-slices/14-copy/02-hacker-incident/main.go
function main (line 17) | func main() {
FILE: 16-slices/15-multi-dimensional-slices/version-1/main.go
function main (line 15) | func main() {
FILE: 16-slices/15-multi-dimensional-slices/version-2/main.go
function main (line 15) | func main() {
FILE: 16-slices/15-multi-dimensional-slices/version-3/main.go
function main (line 17) | func main() {
function fetch (line 30) | func fetch() [][]int {
FILE: 16-slices/exercises/01-declare-nil/main.go
function main (line 38) | func main() {
FILE: 16-slices/exercises/01-declare-nil/solution/main.go
function main (line 13) | func main() {
FILE: 16-slices/exercises/02-empty/main.go
function main (line 28) | func main() {
FILE: 16-slices/exercises/02-empty/solution/main.go
function main (line 13) | func main() {
FILE: 16-slices/exercises/03-slice-literal/main.go
function main (line 44) | func main() {
FILE: 16-slices/exercises/03-slice-literal/solution/main.go
function main (line 13) | func main() {
FILE: 16-slices/exercises/04-declare-arrays-as-slices/main.go
function main (line 31) | func main() {
FILE: 16-slices/exercises/04-declare-arrays-as-slices/solution/main.go
function main (line 13) | func main() {
FILE: 16-slices/exercises/05-fix-the-problems/main.go
function main (line 27) | func main() {
FILE: 16-slices/exercises/05-fix-the-problems/solution/main.go
function main (line 17) | func main() {
FILE: 16-slices/exercises/06-compare-the-slices/main.go
function main (line 36) | func main() {
FILE: 16-slices/exercises/06-compare-the-slices/solution/main.go
function main (line 17) | func main() {
FILE: 16-slices/exercises/07-append/main.go
function main (line 24) | func main() {
FILE: 16-slices/exercises/07-append/solution/main.go
function main (line 16) | func main() {
FILE: 16-slices/exercises/08-append-2/main.go
function main (line 48) | func main() {
FILE: 16-slices/exercises/08-append-2/solution/main.go
function main (line 16) | func main() {
FILE: 16-slices/exercises/09-append-3-fix/main.go
function main (line 26) | func main() {
FILE: 16-slices/exercises/09-append-3-fix/solution/main.go
function main (line 13) | func main() {
FILE: 16-slices/exercises/10-append-sort-nums/main.go
function main (line 45) | func main() {
FILE: 16-slices/exercises/10-append-sort-nums/solution/main.go
function main (line 18) | func main() {
FILE: 16-slices/exercises/11-housing-prices/main.go
function main (line 69) | func main() {
FILE: 16-slices/exercises/11-housing-prices/solution/main.go
function main (line 17) | func main() {
FILE: 16-slices/exercises/12-housing-prices-averages/main.go
function main (line 33) | func main() {
FILE: 16-slices/exercises/12-housing-prices-averages/solution/main.go
function main (line 17) | func main() {
FILE: 16-slices/exercises/13-slicing-basics/main.go
function main (line 59) | func main() {
FILE: 16-slices/exercises/13-slicing-basics/solution/main.go
function main (line 17) | func main() {
FILE: 16-slices/exercises/14-slicing-by-args/main.go
function main (line 114) | func main() {
FILE: 16-slices/exercises/14-slicing-by-args/solution/main.go
function main (line 17) | func main() {
FILE: 16-slices/exercises/15-slicing-housing-prices/main.go
function main (line 126) | func main() {
FILE: 16-slices/exercises/15-slicing-housing-prices/solution/main.go
function main (line 17) | func main() {
FILE: 16-slices/exercises/16-internals-backing-array-fix/main.go
function main (line 35) | func main() {
FILE: 16-slices/exercises/16-internals-backing-array-fix/solution/main.go
function main (line 15) | func main() {
FILE: 16-slices/exercises/17-internals-backing-array-sort/main.go
function main (line 43) | func main() {
FILE: 16-slices/exercises/17-internals-backing-array-sort/solution/main.go
function main (line 16) | func main() {
FILE: 16-slices/exercises/18-internals-slice-header/main.go
constant size (line 74) | size = 1e7
function main (line 76) | func main() {
function passArray (line 117) | func passArray(items [size]int) {
function passSlice (line 125) | func passSlice(items []int) {
function report (line 132) | func report(msg string) {
FILE: 16-slices/exercises/18-internals-slice-header/solution/main.go
constant size (line 18) | size = 1e7
function main (line 20) | func main() {
function passArray (line 48) | func passArray(items [size]int) {
function passSlice (line 53) | func passSlice(items []int) {
function report (line 57) | func report(msg string) {
FILE: 16-slices/exercises/19-observe-len-cap/main.go
function main (line 21) | func main() {
FILE: 16-slices/exercises/19-observe-len-cap/solution/main.go
function main (line 13) | func main() {
FILE: 16-slices/exercises/20-observe-the-cap-growth/main.go
function main (line 42) | func main() {}
FILE: 16-slices/exercises/20-observe-the-cap-growth/solution/main.go
function main (line 13) | func main() {
FILE: 16-slices/exercises/21-correct-the-lyric/main.go
function main (line 66) | func main() {
FILE: 16-slices/exercises/21-correct-the-lyric/solution/main.go
function main (line 16) | func main() {
FILE: 16-slices/exercises/22-adv-ops-practice/main.go
function main (line 26) | func main() {
function init (line 136) | func init() {
FILE: 16-slices/exercises/22-adv-ops-practice/solution/main.go
function main (line 15) | func main() {
function init (line 129) | func init() {
FILE: 16-slices/exercises/23-limit-the-backing-array-sharing/api/api.go
function Read (line 14) | func Read(start, stop int) []int {
function All (line 27) | func All() []int {
FILE: 16-slices/exercises/23-limit-the-backing-array-sharing/main.go
function main (line 80) | func main() {
FILE: 16-slices/exercises/23-limit-the-backing-array-sharing/solution/api/api.go
function Read (line 14) | func Read(start, stop int) []int {
function All (line 28) | func All() []int {
FILE: 16-slices/exercises/23-limit-the-backing-array-sharing/solution/main.go
function main (line 17) | func main() {
FILE: 16-slices/exercises/24-fix-the-memory-leak/api/api.go
function Read (line 20) | func Read() []int {
function Report (line 39) | func Report() {
FILE: 16-slices/exercises/24-fix-the-memory-leak/main.go
function main (line 102) | func main() {
FILE: 16-slices/exercises/24-fix-the-memory-leak/solution/api/api.go
function Read (line 20) | func Read() []int {
function Report (line 39) | func Report() {
FILE: 16-slices/exercises/24-fix-the-memory-leak/solution/main.go
function main (line 18) | func main() {
FILE: 16-slices/exercises/25-add-lines/main.go
function main (line 72) | func main() {
function init (line 97) | func init() {
FILE: 16-slices/exercises/25-add-lines/solution/main.go
function main (line 18) | func main() {
function init (line 95) | func init() {
FILE: 16-slices/exercises/26-print-daily-requests/main.go
function main (line 66) | func main() {
FILE: 16-slices/exercises/26-print-daily-requests/solution/main.go
function main (line 16) | func main() {
FILE: 17-project-empty-file-finder/01-fetch-the-files/main.go
function main (line 17) | func main() {
FILE: 17-project-empty-file-finder/02-write-to-a-file/main.go
function main (line 17) | func main() {
FILE: 17-project-empty-file-finder/03-optimize/main.go
function main (line 17) | func main() {
FILE: 17-project-empty-file-finder/exercises/1-sort-to-a-file/main.go
function main (line 50) | func main() {
FILE: 17-project-empty-file-finder/exercises/1-sort-to-a-file/solution/main.go
function main (line 18) | func main() {
FILE: 17-project-empty-file-finder/exercises/2-sort-to-a-file-2/main.go
function main (line 58) | func main() {
FILE: 17-project-empty-file-finder/exercises/2-sort-to-a-file-2/solution/main.go
function main (line 19) | func main() {
FILE: 17-project-empty-file-finder/exercises/3-print-directories/main.go
function main (line 70) | func main() {
FILE: 17-project-empty-file-finder/exercises/3-print-directories/solution/main.go
function main (line 17) | func main() {
FILE: 18-project-bouncing-ball/01-draw-the-board/main.go
function main (line 15) | func main() {
FILE: 18-project-bouncing-ball/02-add-a-buffer/main.go
function main (line 15) | func main() {
FILE: 18-project-bouncing-ball/03-animate/main.go
function main (line 18) | func main() {
FILE: 18-project-bouncing-ball/exercises/01-find-the-bug/main.go
function main (line 44) | func main() {
FILE: 18-project-bouncing-ball/exercises/01-find-the-bug/solution/main.go
function main (line 18) | func main() {
FILE: 18-project-bouncing-ball/exercises/02-width-and-height/main.go
function main (line 72) | func main() {
FILE: 18-project-bouncing-ball/exercises/02-width-and-height/solution/main.go
function main (line 20) | func main() {
FILE: 18-project-bouncing-ball/exercises/03-previous-positions/main.go
function main (line 44) | func main() {
FILE: 18-project-bouncing-ball/exercises/03-previous-positions/solution/main.go
function main (line 19) | func main() {
FILE: 18-project-bouncing-ball/exercises/04-single-dimensional/main.go
function main (line 39) | func main() {
FILE: 18-project-bouncing-ball/exercises/04-single-dimensional/solution/main.go
function main (line 19) | func main() {
FILE: 18-project-bouncing-ball/exercises/05-no-slice/main.go
function main (line 38) | func main() {
FILE: 18-project-bouncing-ball/exercises/05-no-slice/solution/main.go
function main (line 19) | func main() {
FILE: 19-strings-runes-bytes/01-bytes-runes-strings-basics/main.go
function main (line 13) | func main() {
FILE: 19-strings-runes-bytes/02-bytes-runes-strings-charset-table/main.go
function main (line 18) | func main() {
FILE: 19-strings-runes-bytes/03-bytes-runes-strings-examples/main.go
function main (line 17) | func main() {
FILE: 19-strings-runes-bytes/04-rune-decoding/01/main.go
function main (line 16) | func main() {
FILE: 19-strings-runes-bytes/04-rune-decoding/02/benchmarks/main.go
function decoder (line 29) | func decoder(w []byte) {
function forRange (line 34) | func forRange(w []byte) {
function concater (line 47) | func concater(w []byte) {
function bench (line 53) | func bench(technique func([]byte)) testing.BenchmarkResult {
function main (line 61) | func main() {
FILE: 19-strings-runes-bytes/04-rune-decoding/02/main.go
function main (line 17) | func main() {
FILE: 19-strings-runes-bytes/05-internals/main.go
function main (line 16) | func main() {
type StringHeader (line 36) | type StringHeader struct
function dump (line 43) | func dump(s string) {
FILE: 19-strings-runes-bytes/exercises/01-convert/main.go
function main (line 34) | func main() {
FILE: 19-strings-runes-bytes/exercises/01-convert/solution/main.go
function main (line 13) | func main() {
FILE: 19-strings-runes-bytes/exercises/02-print-the-runes/main.go
function main (line 34) | func main() {
FILE: 19-strings-runes-bytes/exercises/02-print-the-runes/solution/main.go
function main (line 13) | func main() {
FILE: 19-strings-runes-bytes/exercises/03-rune-manipulator/main.go
function main (line 20) | func main() {
FILE: 19-strings-runes-bytes/exercises/03-rune-manipulator/solution/main.go
function main (line 16) | func main() {
FILE: 20-project-spam-masker/01-step-1/main.go
function main (line 26) | func main() {
FILE: 20-project-spam-masker/02-step-2/main.go
constant link (line 27) | link = "http://"
constant nlink (line 28) | nlink = len(link)
constant mask (line 29) | mask = '*'
function main (line 32) | func main() {
FILE: 20-project-spam-masker/03-step-2-no-append/main.go
constant link (line 27) | link = "http://"
constant nlink (line 28) | nlink = len(link)
constant mask (line 29) | mask = '*'
function main (line 32) | func main() {
FILE: 21-project-text-wrapper/main.go
function main (line 16) | func main() {
FILE: 22-maps/01-english-dict/01-as-a-slice/main.go
function main (line 16) | func main() {
FILE: 22-maps/01-english-dict/02-as-a-map/main.go
function main (line 15) | func main() {
FILE: 22-maps/02-english-dict-map-populate/main.go
function main (line 16) | func main() {
FILE: 22-maps/03-internals-cloning/main.go
function main (line 16) | func main() {
FILE: 22-maps/exercises/01-warm-up/main.go
function main (line 27) | func main() {
FILE: 22-maps/exercises/01-warm-up/solution/main.go
function main (line 13) | func main() {
FILE: 22-maps/exercises/02-populate/main.go
function main (line 72) | func main() {
FILE: 22-maps/exercises/02-populate/solution/main.go
function main (line 13) | func main() {
FILE: 22-maps/exercises/03-students/main.go
function main (line 55) | func main() {
FILE: 22-maps/exercises/03-students/solution/main.go
function main (line 17) | func main() {
FILE: 23-input-scanning/01-scanning/main.go
function main (line 17) | func main() {
FILE: 23-input-scanning/02-map-as-sets/main.go
function main (line 19) | func main() {
FILE: 23-input-scanning/03-project-log-parser/main.go
function main (line 20) | func main() {
FILE: 23-input-scanning/exercises/01-uppercaser/main.go
function main (line 27) | func main() {
FILE: 23-input-scanning/exercises/01-uppercaser/solution/main.go
function main (line 18) | func main() {
FILE: 23-input-scanning/exercises/02-unique-words/main.go
function main (line 34) | func main() {
FILE: 23-input-scanning/exercises/02-unique-words/solution/main.go
function main (line 17) | func main() {
FILE: 23-input-scanning/exercises/03-unique-words-2/main.go
function main (line 35) | func main() {
FILE: 23-input-scanning/exercises/03-unique-words-2/solution/main.go
function main (line 19) | func main() {
FILE: 23-input-scanning/exercises/04-grep/main.go
function main (line 36) | func main() {
FILE: 23-input-scanning/exercises/04-grep/solution/main.go
function main (line 18) | func main() {
FILE: 23-input-scanning/exercises/05-quit/main.go
function main (line 39) | func main() {
FILE: 23-input-scanning/exercises/05-quit/solution/main.go
function main (line 18) | func main() {
FILE: 23-input-scanning/exercises/06-log-parser/main.go
function main (line 48) | func main() {
FILE: 24-structs/01-intro/main.go
function main (line 13) | func main() {
FILE: 24-structs/02-basics/main.go
function main (line 13) | func main() {
FILE: 24-structs/03-compare-assign/main.go
type song (line 14) | type song struct
type playlist (line 19) | type playlist struct
function main (line 29) | func main() {
FILE: 24-structs/04-embedding/main.go
function main (line 15) | func main() {
FILE: 24-structs/05-project-log-parser-structs/main.go
type result (line 21) | type result struct
type parser (line 28) | type parser struct
function main (line 35) | func main() {
FILE: 24-structs/06-encoding/main.go
type permissions (line 16) | type permissions
type user (line 18) | type user struct
function main (line 28) | func main() {
FILE: 24-structs/07-decoding/main.go
type user (line 18) | type user struct
function main (line 23) | func main() {
FILE: 24-structs/08-decoding-2/main.go
type user (line 20) | type user struct
function main (line 35) | func main() {
FILE: 24-structs/exercises/01-warmup/main.go
function main (line 39) | func main() {
FILE: 24-structs/exercises/01-warmup/solution/main.go
function main (line 13) | func main() {
FILE: 24-structs/exercises/02-list/main.go
function main (line 32) | func main() {
FILE: 24-structs/exercises/02-list/solution/main.go
function main (line 17) | func main() {
FILE: 24-structs/exercises/03-query-by-id/main.go
function main (line 46) | func main() {
FILE: 24-structs/exercises/03-query-by-id/solution/main.go
function main (line 19) | func main() {
FILE: 24-structs/exercises/04-encode/main.go
function main (line 63) | func main() {
FILE: 24-structs/exercises/04-encode/solution/main.go
function main (line 20) | func main() {
FILE: 24-structs/exercises/05-decode/main.go
constant data (line 34) | data = `
function main (line 56) | func main() {
FILE: 24-structs/exercises/05-decode/solution/main.go
constant data (line 20) | data = `
function main (line 42) | func main() {
FILE: 25-functions/01-basics/bad.go
function showN (line 13) | func showN() {
function incrN (line 20) | func incrN() {
FILE: 25-functions/01-basics/main.go
function main (line 29) | func main() {
FILE: 25-functions/02-basics/main.go
function main (line 16) | func main() {
function show (line 59) | func show(n int) {
function incrWrong (line 66) | func incrWrong(n int) {
function incr (line 73) | func incr(n int) int {
function incrBy (line 78) | func incrBy(n, factor int) int {
function incrByStr (line 82) | func incrByStr(n int, factor string) (int, error) {
function sanitize (line 88) | func sanitize(n int, err error) int {
function limit (line 95) | func limit(n, lim int) (m int) {
FILE: 25-functions/03-refactor-to-funcs/main.go
function main (line 19) | func main() {
FILE: 25-functions/03-refactor-to-funcs/parser.go
type result (line 18) | type result struct
type parser (line 25) | type parser struct
function newParser (line 33) | func newParser() parser {
function parse (line 38) | func parse(p parser, line string) (parsed result, err error) {
FILE: 25-functions/04-pass-by-value-semantics/main.go
function main (line 19) | func main() {
FILE: 25-functions/04-pass-by-value-semantics/parser.go
type result (line 18) | type result struct
type parser (line 25) | type parser struct
function newParser (line 33) | func newParser() parser {
function parse (line 38) | func parse(p parser, line string) (parsed result, err error) {
function update (line 57) | func update(p parser, parsed result) parser {
FILE: 25-functions/exercises/refactor-to-funcs-1/main.go
function main (line 66) | func main() {
FILE: 25-functions/exercises/refactor-to-funcs-1/solution/games.go
type item (line 13) | type item struct
type game (line 19) | type game struct
function load (line 24) | func load() (games []game) {
function addGame (line 31) | func addGame(games []game, g game) []game {
function newGame (line 35) | func newGame(id, price int, name, genre string) game {
function indexByID (line 42) | func indexByID(games []game) (byID map[int]game) {
function printGame (line 50) | func printGame(g game) {
FILE: 25-functions/exercises/refactor-to-funcs-1/solution/main.go
function main (line 19) | func main() {
FILE: 25-functions/exercises/refactor-to-funcs-2/games.go
type item (line 13) | type item struct
type game (line 19) | type game struct
function load (line 24) | func load() (games []game) {
function addGame (line 31) | func addGame(games []game, g game) []game {
function newGame (line 35) | func newGame(id, price int, name, genre string) game {
function indexByID (line 42) | func indexByID(games []game) (byID map[int]game) {
function printGame (line 50) | func printGame(g game) {
FILE: 25-functions/exercises/refactor-to-funcs-2/main.go
function main (line 67) | func main() {
FILE: 25-functions/exercises/refactor-to-funcs-2/solution/commands.go
function runCmd (line 17) | func runCmd(input string, games []game, byID map[int]game) bool {
function cmdQuit (line 38) | func cmdQuit() bool {
function cmdList (line 43) | func cmdList(games []game) bool {
function cmdByID (line 50) | func cmdByID(cmd []string, games []game, byID map[int]game) bool {
FILE: 25-functions/exercises/refactor-to-funcs-2/solution/games.go
type item (line 13) | type item struct
type game (line 19) | type game struct
function load (line 24) | func load() (games []game) {
function addGame (line 31) | func addGame(games []game, g game) []game {
function newGame (line 35) | func newGame(id, price int, name, genre string) game {
function indexByID (line 42) | func indexByID(games []game) (byID map[int]game) {
function printGame (line 50) | func printGame(g game) {
FILE: 25-functions/exercises/refactor-to-funcs-2/solution/main.go
function main (line 17) | func main() {
FILE: 25-functions/exercises/refactor-to-funcs-3/commands.go
function runCmd (line 17) | func runCmd(input string, games []game, byID map[int]game) bool {
function cmdQuit (line 38) | func cmdQuit() bool {
function cmdList (line 43) | func cmdList(games []game) bool {
function cmdByID (line 50) | func cmdByID(cmd []string, games []game, byID map[int]game) bool {
FILE: 25-functions/exercises/refactor-to-funcs-3/games.go
constant data (line 13) | data = `
type item (line 35) | type item struct
type game (line 41) | type game struct
function load (line 46) | func load() (games []game) {
function addGame (line 53) | func addGame(games []game, g game) []game {
function newGame (line 57) | func newGame(id, price int, name, genre string) game {
function indexByID (line 64) | func indexByID(games []game) (byID map[int]game) {
function printGame (line 72) | func printGame(g game) {
FILE: 25-functions/exercises/refactor-to-funcs-3/main.go
function main (line 43) | func main() {
FILE: 25-functions/exercises/refactor-to-funcs-3/solution/commands.go
function runCmd (line 18) | func runCmd(input string, games []game, byID map[int]game) bool {
function cmdQuit (line 42) | func cmdQuit() bool {
function cmdList (line 47) | func cmdList(games []game) bool {
function cmdByID (line 54) | func cmdByID(cmd []string, games []game, byID map[int]game) bool {
function cmdSave (line 77) | func cmdSave(games []game) bool {
FILE: 25-functions/exercises/refactor-to-funcs-3/solution/games.go
constant data (line 16) | data = `
type item (line 38) | type item struct
type game (line 44) | type game struct
type jsonGame (line 50) | type jsonGame struct
function load (line 57) | func load() (games []game) {
function addGame (line 72) | func addGame(games []game, g game) []game {
function newGame (line 76) | func newGame(id, price int, name, genre string) game {
function indexByID (line 83) | func indexByID(games []game) (byID map[int]game) {
function printGame (line 91) | func printGame(g game) {
FILE: 25-functions/exercises/refactor-to-funcs-3/solution/main.go
function main (line 17) | func main() {
FILE: 25-functions/exercises/rewrite-log-parser-using-funcs/main.go
type result (line 21) | type result struct
type parser (line 28) | type parser struct
function main (line 35) | func main() {
FILE: 26-pointers/01-pointers/main.go
function main (line 13) | func main() {
FILE: 26-pointers/02-pointers-basic-examples/main.go
function main (line 13) | func main() {
function passPtrVal (line 53) | func passPtrVal(pn *int) {
function passVal (line 65) | func passVal(n int) int {
FILE: 26-pointers/03-pointers-composites/main.go
function main (line 16) | func main() {
type house (line 32) | type house struct
function structs (line 37) | func structs() {
function addRoomPtr (line 49) | func addRoomPtr(h *house) {
function addRoom (line 56) | func addRoom(h house) {
function maps (line 63) | func maps() {
function fix (line 71) | func fix(m map[string]int) {
function slices (line 79) | func slices() {
function upPtr (line 89) | func upPtr(list *[]string) {
function up (line 101) | func up(list []string) {
function arrays (line 114) | func arrays() {
function incr (line 125) | func incr(nums [3]int) {
function incrByPtr (line 133) | func incrByPtr(nums *[3]int) {
FILE: 26-pointers/04-log-parser-pointers/main.go
function main (line 19) | func main() {
function summarize (line 33) | func summarize(p parser) {
function dumpErrs (line 49) | func dumpErrs(errs []error) {
FILE: 26-pointers/04-log-parser-pointers/parser.go
type result (line 18) | type result struct
type parser (line 25) | type parser struct
function newParser (line 34) | func newParser() parser {
function parse (line 39) | func parse(p *parser, line string) (parsed result) {
function update (line 64) | func update(p *parser, parsed result) {
FILE: 26-pointers/05-log-parser-pointers-vs-values/main.go
function main (line 19) | func main() {
function summarize (line 33) | func summarize(p *parser) {
function dumpErrs (line 46) | func dumpErrs(errs []error) {
FILE: 26-pointers/05-log-parser-pointers-vs-values/parser.go
type result (line 18) | type result struct
type parser (line 25) | type parser struct
function newParser (line 34) | func newParser() *parser {
function parse (line 39) | func parse(p *parser, line string) (r result) {
function update (line 64) | func update(p *parser, r result) {
function err (line 85) | func err(p *parser) error {
FILE: 26-pointers/exercises/01-basics/main.go
type computer (line 19) | type computer struct
function main (line 23) | func main() {
FILE: 26-pointers/exercises/01-basics/solution/main.go
type computer (line 13) | type computer struct
function main (line 17) | func main() {
function change (line 85) | func change(c *computer, brand string) {
function valueOf (line 90) | func valueOf(c *computer) computer {
function newComputer (line 95) | func newComputer(brand string) *computer {
FILE: 26-pointers/exercises/02-swap/main.go
function main (line 45) | func main() {
FILE: 26-pointers/exercises/02-swap/solution/main.go
function main (line 13) | func main() {
function swap (line 24) | func swap(a, b *float64) {
function swapAddr (line 28) | func swapAddr(a, b *float64) (*float64, *float64) {
FILE: 26-pointers/exercises/03-fix-the-crash/main.go
type computer (line 21) | type computer struct
function main (line 25) | func main() {
function change (line 31) | func change(c *computer, brand string) {
FILE: 26-pointers/exercises/03-fix-the-crash/solution/main.go
type computer (line 13) | type computer struct
function main (line 17) | func main() {
function change (line 23) | func change(c *computer, brand string) {
FILE: 26-pointers/exercises/04-simplify/main.go
function main (line 18) | func main() {
function load (line 31) | func load(m *map[int]string, students *[]string) {
FILE: 26-pointers/exercises/04-simplify/solution/main.go
function main (line 13) | func main() {
function load (line 26) | func load(m map[int]string, students []string) {
FILE: 26-pointers/exercises/05-log-parser/main.go
function main (line 19) | func main() {
FILE: 26-pointers/exercises/05-log-parser/parser.go
type result (line 18) | type result struct
type parser (line 25) | type parser struct
function newParser (line 33) | func newParser() parser {
function parse (line 38) | func parse(p parser, line string) (parsed result, err error) {
function update (line 57) | func update(p parser, parsed result) parser {
FILE: advfuncs/01-variadic-funcs/main.go
function main (line 13) | func main() {
function investigate (line 47) | func investigate(msg string, nums ...int) {
function double (line 55) | func double(nums ...int) {
function avg (line 61) | func avg(nums ...int) int {
function avgNoVariadic (line 65) | func avgNoVariadic(nums []int) int {
function sum (line 69) | func sum(nums []int) (total int) {
FILE: advfuncs/02-func-values/main.go
type filterFunc (line 13) | type filterFunc
function main (line 15) | func main() {
function isEven (line 20) | func isEven(n int) bool {
function isOdd (line 24) | func isOdd(m int) bool {
function signatures (line 28) | func signatures() {
function funcValues (line 34) | func funcValues() {
FILE: advfuncs/03-func-to-func/main.go
type filterFunc (line 17) | type filterFunc
function main (line 19) | func main() {
function unpunct (line 37) | func unpunct(r rune) rune {
function filter (line 44) | func filter(f filterFunc, nums ...int) (filtered []int) {
function filterOdds (line 53) | func filterOdds(nums ...int) (filtered []int) {
function filterEvens (line 62) | func filterEvens(nums ...int) (filtered []int) {
function isEven (line 71) | func isEven(n int) bool {
function isOdd (line 75) | func isOdd(m int) bool {
function signatures (line 79) | func signatures() {
FILE: advfuncs/04-closures/main.go
type filterFunc (line 13) | type filterFunc
function main (line 15) | func main() {
function printer (line 59) | func printer(filterers []filterFunc, nums ...int) {
function greaterThan6 (line 65) | func greaterThan6(n int) bool { return n > 6 }
function greaterThan3 (line 66) | func greaterThan3(n int) bool { return n > 3 }
function isEven (line 67) | func isEven(n int) bool { return n%2 == 0 }
function isOdd (line 68) | func isOdd(m int) bool { return m%2 == 1 }
function filter (line 70) | func filter(f filterFunc, nums ...int) (filtered []int) {
FILE: advfuncs/05-higher-order-funcs/main.go
type filterFunc (line 15) | type filterFunc
function main (line 17) | func main() {
function reverse (line 31) | func reverse(f filterFunc) filterFunc {
function greater (line 37) | func greater(min int) filterFunc {
function lesseq (line 43) | func lesseq(max int) filterFunc {
function filter (line 49) | func filter(f filterFunc, nums ...int) (filtered []int) {
function isEven (line 58) | func isEven(n int) bool { return n%2 == 0 }
function isOdd (line 59) | func isOdd(m int) bool { return m%2 == 1 }
FILE: advfuncs/06-functional-programming/main.go
type filterFunc (line 15) | type filterFunc
function main (line 17) | func main() {
function chain (line 48) | func chain(filters ...filterFunc) filterFunc {
function uniques (line 59) | func uniques() filterFunc {
function reverse (line 70) | func reverse(f filterFunc) filterFunc {
function greater (line 76) | func greater(min int) filterFunc {
function lesseq (line 82) | func lesseq(max int) filterFunc {
function filter (line 88) | func filter(f filterFunc, nums ...int) (filtered []int) {
function isEven (line 97) | func isEven(n int) bool { return n%2 == 0 }
function isOdd (line 98) | func isOdd(m int) bool { return m%2 == 1 }
FILE: advfuncs/07-deferred-funcs/main.go
function main (line 16) | func main() {
function findTheMeaningNoDefer (line 22) | func findTheMeaningNoDefer() {
function findTheMeaning (line 32) | func findTheMeaning() {
function measure (line 39) | func measure(name string) func() {
function stacked (line 48) | func stacked() {
function single (line 56) | func single() {
FILE: advfuncs/08-png-detector-with-panic/main.go
function main (line 42) | func main() {
function list (line 57) | func list(format string, files []string) {
function detect (line 66) | func detect(format string, filenames []string) (valids []string) {
function headerOf (line 83) | func headerOf(format string) string {
function read (line 94) | func read(filename string, buf []byte) error {
FILE: advfuncs/08-png-detector/main.go
function main (line 18) | func main() {
function detect (line 36) | func detect(filenames []string) (pngs []string) {
function read (line 54) | func read(filename string, buf []byte) error {
function detectPNGUnsafeAndVerbose (line 74) | func detectPNGUnsafeAndVerbose(filenames []string) (valids []string) {
function detectPNGWrong (line 110) | func detectPNGWrong(filenames []string) (pngs []string) {
FILE: advfuncs/10-image-detector-recover/main.go
function main (line 18) | func main() {
function list (line 45) | func list(format string, files []string) {
function detect (line 54) | func detect(format string, filenames []string) (pngs []string) {
function headerOf (line 70) | func headerOf(format string) string {
function read (line 82) | func read(filename string, buf []byte) error {
FILE: advfuncs/10b-named-params/main.go
function main (line 22) | func main() {
function list (line 43) | func list(format string, files []string) {
FILE: advfuncs/exercises/01-refactor/main.go
function main (line 29) | func main() {
function headerOf (line 33) | func headerOf(format string) string {
FILE: advfuncs/exercises/01-refactor/solution/main.go
function main (line 13) | func main() {
function headerOf (line 22) | func headerOf(format string) (header string) {
FILE: advfuncs/new/01-intro/funcval/main.go
function main (line 16) | func main() {
FILE: advfuncs/new/01-intro/passfunc/main.go
function main (line 16) | func main() {
function mapx (line 30) | func mapx(mapping func(rune) rune, s string) string {
function calm (line 42) | func calm(r rune) rune {
function excite (line 49) | func excite(r rune) rune {
FILE: concurrency/xxx-monte-carlo/main.go
function main (line 21) | func main() {
function exit (line 38) | func exit(msg string) {
function measure (line 43) | func measure(start time.Time) func() time.Duration {
function spread (line 51) | func spread(samples int, P int) (estimated float64) {
function estimate (line 64) | func estimate(N int) float64 {
FILE: etc/stratch/main.go
function main (line 12) | func main() {
FILE: first/explain/comments/main.go
function main (line 20) | func main() {
FILE: first/explain/expressions/01-operator/main.go
function main (line 15) | func main() {
FILE: first/explain/expressions/02-call-expression/main.go
function main (line 16) | func main() {
FILE: first/explain/importing/01-file-scope/main.go
function main (line 13) | func main() {
FILE: first/explain/importing/02-renaming/main.go
function main (line 14) | func main() {
FILE: first/explain/packages/scopes/bye.go
function bye (line 13) | func bye() {
FILE: first/explain/packages/scopes/hey.go
function hey (line 13) | func hey() {
FILE: first/explain/packages/scopes/main.go
function main (line 13) | func main() {
FILE: first/explain/packages/what/bye.go
function bye (line 13) | func bye() {
FILE: first/explain/packages/what/hey.go
function hey (line 13) | func hey() {
FILE: first/explain/packages/what/main.go
function main (line 13) | func main() {
FILE: first/explain/scopes/01-scopes/main.go
constant ok (line 15) | ok = true
function main (line 18) | func main() { // block scope starts
FILE: first/explain/scopes/02-block-scope/main.go
function nope (line 11) | func nope() { // block scope starts
function main (line 20) | func main() { // block scope starts
FILE: first/explain/scopes/03-nested-scope/main.go
function nested (line 19) | func nested() { // block scope starts
function main (line 30) | func main() { // block scope starts
FILE: first/explain/statements/01-execution-flow/main.go
function main (line 15) | func main() {
FILE: first/explain/statements/02-semicolons/main.go
function main (line 15) | func main() {
FILE: first/first/exercises/01/main.go
function main (line 25) | func main() {
FILE: first/first/exercises/01/solution/main.go
function main (line 18) | func main() {
FILE: first/first/main.go
function main (line 32) | func main() {
FILE: first/printer-exercise/solution/golang/cmd/main.go
function main (line 19) | func main() {
FILE: first/printer-exercise/solution/golang/go.go
function Version (line 16) | func Version() string {
FILE: first/printer/cmd/main.go
function main (line 14) | func main() {
FILE: first/printer/printer.go
function Hello (line 14) | func Hello() {
FILE: interfaces/01-methods/book.go
type book (line 13) | type book struct
method print (line 18) | func (b book) print() {
FILE: interfaces/01-methods/game.go
type game (line 13) | type game struct
method print (line 18) | func (g game) print() {
FILE: interfaces/01-methods/main.go
function main (line 11) | func main() {
FILE: interfaces/02-receivers/book.go
type book (line 13) | type book struct
method print (line 18) | func (b book) print() {
FILE: interfaces/02-receivers/game.go
type game (line 13) | type game struct
method print (line 21) | func (g *game) print() {
method discount (line 28) | func (g *game) discount(ratio float64) {
FILE: interfaces/02-receivers/huge.go
type huge (line 15) | type huge struct
method addr (line 24) | func (h *huge) addr() {
FILE: interfaces/02-receivers/main.go
function main (line 11) | func main() {
FILE: interfaces/03-nonstructs/book.go
type book (line 13) | type book struct
method print (line 18) | func (b book) print() {
FILE: interfaces/03-nonstructs/game.go
type game (line 13) | type game struct
method print (line 18) | func (g *game) print() {
method discount (line 22) | func (g *game) discount(ratio float64) {
FILE: interfaces/03-nonstructs/list.go
type list (line 15) | type list
method print (line 17) | func (l list) print() {
FILE: interfaces/03-nonstructs/main.go
function main (line 11) | func main() {
FILE: interfaces/03-nonstructs/money.go
type money (line 13) | type money
method string (line 15) | func (m money) string() string {
FILE: interfaces/04-interfaces/book.go
type book (line 13) | type book struct
method print (line 18) | func (b book) print() {
FILE: interfaces/04-interfaces/game.go
type game (line 13) | type game struct
method print (line 18) | func (g *game) print() {
method discount (line 22) | func (g *game) discount(ratio float64) {
FILE: interfaces/04-interfaces/list.go
type printer (line 13) | type printer interface
type list (line 17) | type list
method print (line 19) | func (l list) print() {
FILE: interfaces/04-interfaces/main.go
function main (line 13) | func main() {
FILE: interfaces/04-interfaces/money.go
type money (line 13) | type money
method string (line 15) | func (m money) string() string {
FILE: interfaces/04-interfaces/power/blender.go
type Blender (line 16) | type Blender struct
method Draw (line 19) | func (Blender) Draw(power int) {
FILE: interfaces/04-interfaces/power/kettle.go
type Kettle (line 16) | type Kettle struct
method Draw (line 19) | func (Kettle) Draw(power int) {
FILE: interfaces/04-interfaces/power/main.go
function main (line 20) | func main() {
FILE: interfaces/04-interfaces/power/mixer.go
type Mixer (line 16) | type Mixer struct
method Draw (line 19) | func (Mixer) Draw(power int) {
FILE: interfaces/04-interfaces/power/player.go
type Player (line 16) | type Player struct
method Draw (line 19) | func (Player) Draw(power int) {
FILE: interfaces/04-interfaces/power/socket.go
type PowerDrawer (line 18) | type PowerDrawer interface
type Socket (line 23) | type Socket struct
method Plug (line 28) | func (s *Socket) Plug(device PowerDrawer) error {
FILE: interfaces/04-interfaces/puzzle.go
type puzzle (line 13) | type puzzle struct
method print (line 20) | func (p puzzle) print() {
FILE: interfaces/05-type-assertion/book.go
type book (line 13) | type book struct
method print (line 18) | func (b book) print() {
FILE: interfaces/05-type-assertion/game.go
type game (line 13) | type game struct
method print (line 18) | func (g *game) print() {
method discount (line 22) | func (g *game) discount(ratio float64) {
FILE: interfaces/05-type-assertion/list.go
type printer (line 13) | type printer interface
type list (line 20) | type list
method print (line 22) | func (l list) print() {
method discount (line 35) | func (l list) discount(ratio float64) {
FILE: interfaces/05-type-assertion/main.go
function main (line 11) | func main() {
FILE: interfaces/05-type-assertion/money.go
type money (line 13) | type money
method string (line 15) | func (m money) string() string {
FILE: interfaces/05-type-assertion/puzzle.go
type puzzle (line 13) | type puzzle struct
method print (line 18) | func (p puzzle) print() {
FILE: interfaces/05-type-assertion/toy.go
type toy (line 13) | type toy struct
method print (line 18) | func (t *toy) print() {
method discount (line 22) | func (t *toy) discount(ratio float64) {
FILE: interfaces/06-empty-interface/book.go
type book (line 17) | type book struct
method print (line 23) | func (b book) print() {
function format (line 28) | func format(v interface{}) string {
FILE: interfaces/06-empty-interface/empty/main.go
function main (line 13) | func main() {
FILE: interfaces/06-empty-interface/empty2/main.go
function main (line 13) | func main() {
FILE: interfaces/06-empty-interface/game.go
type game (line 13) | type game struct
method print (line 18) | func (g *game) print() {
method discount (line 22) | func (g *game) discount(ratio float64) {
FILE: interfaces/06-empty-interface/list.go
type printer (line 13) | type printer interface
type list (line 17) | type list
method print (line 19) | func (l list) print() {
method discount (line 30) | func (l list) discount(ratio float64) {
FILE: interfaces/06-empty-interface/main.go
function main (line 11) | func main() {
FILE: interfaces/06-empty-interface/money.go
type money (line 13) | type money
method string (line 15) | func (m money) string() string {
FILE: interfaces/06-empty-interface/puzzle.go
type puzzle (line 13) | type puzzle struct
method print (line 18) | func (p puzzle) print() {
FILE: interfaces/06-empty-interface/toy.go
type toy (line 13) | type toy struct
method print (line 18) | func (t *toy) print() {
method discount (line 22) | func (t *toy) discount(ratio float64) {
FILE: interfaces/07-type-switch/book.go
type book (line 17) | type book struct
method print (line 23) | func (b book) print() {
function format (line 28) | func format(v interface{}) string {
FILE: interfaces/07-type-switch/game.go
type game (line 13) | type game struct
method print (line 18) | func (g *game) print() {
method discount (line 22) | func (g *game) discount(ratio float64) {
FILE: interfaces/07-type-switch/list.go
type printer (line 13) | type printer interface
type list (line 17) | type list
method print (line 19) | func (l list) print() {
method discount (line 30) | func (l list) discount(ratio float64) {
FILE: interfaces/07-type-switch/main.go
function main (line 11) | func main() {
FILE: interfaces/07-type-switch/money.go
type money (line 13) | type money
method string (line 15) | func (m money) string() string {
FILE: interfaces/07-type-switch/puzzle.go
type puzzle (line 13) | type puzzle struct
method print (line 18) | func (p puzzle) print() {
FILE: interfaces/07-type-switch/toy.go
type toy (line 13) | type toy struct
method print (line 18) | func (t *toy) print() {
method discount (line 22) | func (t *toy) discount(ratio float64) {
FILE: interfaces/08-promoted-methods/book.go
type book (line 17) | type book struct
method print (line 32) | func (b *book) print() {
function format (line 41) | func format(v interface{}) string {
FILE: interfaces/08-promoted-methods/game.go
type game (line 11) | type game struct
FILE: interfaces/08-promoted-methods/list.go
type item (line 13) | type item interface
type list (line 18) | type list
method print (line 20) | func (l list) print() {
method discount (line 31) | func (l list) discount(ratio float64) {
FILE: interfaces/08-promoted-methods/main.go
function main (line 11) | func main() {
FILE: interfaces/08-promoted-methods/money.go
type money (line 13) | type money
method string (line 15) | func (m money) string() string {
FILE: interfaces/08-promoted-methods/product.go
type product (line 13) | type product struct
method print (line 18) | func (p *product) print() {
method discount (line 22) | func (p *product) discount(ratio float64) {
FILE: interfaces/08-promoted-methods/puzzle.go
type puzzle (line 11) | type puzzle struct
FILE: interfaces/08-promoted-methods/toy.go
type toy (line 11) | type toy struct
FILE: interfaces/09-little-refactor/list.go
type list (line 13) | type list
method print (line 15) | func (l list) print() {
method discount (line 26) | func (l list) discount(ratio float64) {
FILE: interfaces/09-little-refactor/main.go
function main (line 11) | func main() {
FILE: interfaces/09-little-refactor/money.go
type money (line 13) | type money
method string (line 15) | func (m money) string() string {
FILE: interfaces/09-little-refactor/product.go
type product (line 15) | type product struct
method print (line 21) | func (p *product) print() {
method discount (line 25) | func (p *product) discount(ratio float64) {
FILE: interfaces/09-little-refactor/timestamp.go
type timestamp (line 17) | type timestamp struct
method string (line 23) | func (ts timestamp) string() string {
function toTimestamp (line 34) | func toTimestamp(v interface{}) (ts timestamp) {
FILE: interfaces/10-stringer/_handlemethods.go
method handleMethods (line 20) | func (p *pp) handleMethods(argument interface{}) (handled bool) {
FILE: interfaces/10-stringer/list.go
type list (line 15) | type list
method String (line 17) | func (l list) String() string {
method discount (line 32) | func (l list) discount(ratio float64) {
FILE: interfaces/10-stringer/main.go
function main (line 13) | func main() {
FILE: interfaces/10-stringer/money.go
type money (line 13) | type money
method String (line 17) | func (m money) String() string {
FILE: interfaces/10-stringer/product.go
type product (line 15) | type product struct
method String (line 21) | func (p *product) String() string {
method discount (line 25) | func (p *product) discount(ratio float64) {
FILE: interfaces/10-stringer/timestamp.go
type timestamp (line 17) | type timestamp struct
method String (line 25) | func (ts timestamp) String() string {
function toTimestamp (line 36) | func toTimestamp(v interface{}) (ts timestamp) {
FILE: interfaces/11-sort/list.go
type list (line 18) | type list
method String (line 20) | func (l list) String() string {
method discount (line 35) | func (l list) discount(ratio float64) {
method Len (line 44) | func (l list) Len() int { return len(l) }
method Less (line 45) | func (l list) Less(i, j int) bool { return l[i].title < l[j].title }
method Swap (line 46) | func (l list) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
type byRelease (line 49) | type byRelease struct
method Less (line 56) | func (br byRelease) Less(i, j int) bool {
function byReleaseDate (line 68) | func byReleaseDate(l list) sort.Interface {
FILE: interfaces/11-sort/main.go
function main (line 16) | func main() {
FILE: interfaces/11-sort/money.go
type money (line 13) | type money
method String (line 15) | func (m money) String() string {
FILE: interfaces/11-sort/product.go
type product (line 15) | type product struct
method String (line 21) | func (p *product) String() string {
method discount (line 25) | func (p *product) discount(ratio float64) {
FILE: interfaces/11-sort/timestamp.go
type timestamp (line 16) | type timestamp struct
method String (line 20) | func (ts timestamp) String() string {
function toTimestamp (line 30) | func toTimestamp(v interface{}) (ts timestamp) {
FILE: interfaces/12-marshaler/list.go
type list (line 16) | type list
method String (line 18) | func (l list) String() string {
method discount (line 33) | func (l list) discount(ratio float64) {
method Len (line 42) | func (l list) Len() int { return len(l) }
method Less (line 43) | func (l list) Less(i, j int) bool { return l[i].Title < l[j].Title }
method Swap (line 44) | func (l list) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
type byRelease (line 47) | type byRelease struct
method Less (line 49) | func (br byRelease) Less(i, j int) bool {
function byReleaseDate (line 53) | func byReleaseDate(l list) sort.Interface {
FILE: interfaces/12-marshaler/main.go
constant data (line 17) | data = `[
function main (line 35) | func main() {
FILE: interfaces/12-marshaler/money.go
type money (line 13) | type money
method String (line 15) | func (m money) String() string {
FILE: interfaces/12-marshaler/product.go
type product (line 15) | type product struct
method String (line 21) | func (p *product) String() string {
method discount (line 25) | func (p *product) discount(ratio float64) {
FILE: interfaces/12-marshaler/timestamp.go
type timestamp (line 16) | type timestamp struct
method String (line 22) | func (ts timestamp) String() string {
method UnmarshalJSON (line 36) | func (ts *timestamp) UnmarshalJSON(data []byte) error {
method MarshalJSON (line 43) | func (ts timestamp) MarshalJSON() (data []byte, _ error) {
function toTimestamp (line 47) | func toTimestamp(v interface{}) (ts timestamp) {
FILE: interfaces/13-io/main.go
function main (line 17) | func main() {
function ioCopy (line 58) | func ioCopy(dst, src *os.File) error {
function write (line 86) | func write(dst *os.File, buf []byte) error {
function read (line 96) | func read(src *os.File) error {
FILE: interfaces/14-io-reusable/main.go
function main (line 17) | func main() {
function transfer (line 26) | func transfer() (n int64, err error) {
function ioCopy (line 37) | func ioCopy(dst, src *os.File) error {
FILE: interfaces/15-png-detector/main.go
function main (line 19) | func main() {
function transfer (line 41) | func transfer(r io.Reader) (n int64, err error) {
FILE: interfaces/16-io-compose/main.go
function main (line 20) | func main() {
function transfer (line 51) | func transfer(r io.Reader, w io.Writer) (n int64, err error) {
FILE: interfaces/17-write-an-io-reader/main.go
function main (line 18) | func main() {
FILE: interfaces/17-write-an-io-reader/reader.go
type signatureReader (line 19) | type signatureReader struct
method Read (line 25) | func (sr *signatureReader) Read(b []byte) (n int, err error) {
function pngReader (line 51) | func pngReader(r io.Reader) io.Reader {
FILE: interfaces/18-testing/main.go
function main (line 18) | func main() {
FILE: interfaces/18-testing/reader.go
type signatureReader (line 19) | type signatureReader struct
method Read (line 25) | func (sr *signatureReader) Read(b []byte) (n int, err error) {
function pngReader (line 43) | func pngReader(r io.Reader) io.Reader {
FILE: interfaces/18-testing/reader_test.go
function TestCorrectSignature (line 9) | func TestCorrectSignature(t *testing.T) {
function TestIncorrectSignature (line 24) | func TestIncorrectSignature(t *testing.T) {
function TestSummation (line 40) | func TestSummation(t *testing.T) {
FILE: logparser/functional/field.go
type field (line 18) | type field struct
method uatoi (line 23) | func (f *field) uatoi(name, val string) int {
function atoi (line 31) | func atoi(input []byte) (int, error) {
FILE: logparser/functional/filters.go
function noopFilter (line 13) | func noopFilter(r result) bool {
function notUsing (line 17) | func notUsing(filter filterFn) filterFn {
function domainExtFilter (line 23) | func domainExtFilter(domains ...string) filterFn {
function domainFilter (line 34) | func domainFilter(domain string) filterFn {
function orgDomainsFilter (line 40) | func orgDomainsFilter(r result) bool {
FILE: logparser/functional/groupers.go
function domainGrouper (line 15) | func domainGrouper(r result) string {
function pageGrouper (line 19) | func pageGrouper(r result) string {
function noopGrouper (line 24) | func noopGrouper(r result) string {
FILE: logparser/functional/main.go
function main (line 16) | func main() {
FILE: logparser/functional/pipeline.go
type processFn (line 14) | type processFn
type inputFn (line 15) | type inputFn
type outputFn (line 16) | type outputFn
type filterFn (line 17) | type filterFn
type groupFn (line 18) | type groupFn
type pipeline (line 21) | type pipeline struct
method filterBy (line 28) | func (p *pipeline) filterBy(f filterFn) *pipeline { p.filter = f; retu...
method groupBy (line 29) | func (p *pipeline) groupBy(f groupFn) *pipeline { p.group = f; retur...
method from (line 30) | func (p *pipeline) from(f inputFn) *pipeline { p.read = f; return...
method to (line 31) | func (p *pipeline) to(f outputFn) *pipeline { p.write = f; retur...
method defaults (line 33) | func (p *pipeline) defaults() {
method start (line 51) | func (p *pipeline) start() error {
FILE: logparser/functional/result.go
constant fieldsLength (line 16) | fieldsLength = 4
type result (line 19) | type result struct
method add (line 27) | func (r result) add(other result) result {
function parseFields (line 34) | func parseFields(line string) (r result, err error) {
function fastParseFields (line 51) | func fastParseFields(data []byte) (res result, err error) {
FILE: logparser/functional/textreader.go
function textReader (line 17) | func textReader(r io.Reader) inputFn {
FILE: logparser/functional/textwriter.go
constant header (line 25) | header = "%-25s %-10s %10s %10s\n"
constant line (line 26) | line = "%-25s %-10s %10d %10d\n"
constant footer (line 27) | footer = "\n%-36s %10d %10d\n"
constant dash (line 28) | dash = "-"
constant dashLength (line 29) | dashLength = 58
function textWriter (line 32) | func textWriter(w io.Writer) outputFn {
function noWhere (line 54) | func noWhere() outputFn {
FILE: logparser/testing/main.go
function main (line 18) | func main() {
FILE: logparser/testing/main_test.go
constant okIn (line 23) | okIn = `
constant okOut (line 29) | okOut = `
function TestSummary (line 38) | func TestSummary(t *testing.T) {
function run (line 55) | func run(t *testing.T, in, out string) {
FILE: logparser/testing/report/parser.go
type Parser (line 16) | type Parser struct
method Parse (line 28) | func (p *Parser) Parse(line string) {
method Summarize (line 46) | func (p *Parser) Summarize() *Summary {
method Err (line 51) | func (p *Parser) Err() error {
function New (line 23) | func New() *Parser {
FILE: logparser/testing/report/parser_test.go
function newParser (line 18) | func newParser(lines string) *report.Parser {
function TestParserLineErrs (line 24) | func TestParserLineErrs(t *testing.T) {
function TestParserStopsOnErr (line 36) | func TestParserStopsOnErr(t *testing.T) {
function TestParserIncorrectFields (line 47) | func TestParserIncorrectFields(t *testing.T) {
FILE: logparser/testing/report/result.go
type Result (line 22) | type Result struct
method add (line 30) | func (r Result) add(other Result) Result {
function parse (line 39) | func parse(line string) (r Result, err error) {
type field (line 53) | type field struct
method atoi (line 55) | func (f *field) atoi(name, val string) int {
FILE: logparser/testing/report/summary.go
type Summary (line 16) | type Summary struct
method update (line 29) | func (s *Summary) update(r Result) {
method Iterator (line 45) | func (s *Summary) Iterator() (next func() bool, cur func() Result) {
method Total (line 66) | func (s *Summary) Total() Result {
function newSummary (line 24) | func newSummary() *Summary {
FILE: logparser/testing/report/summary_test.go
function TestSummaryTotal (line 17) | func TestSummaryTotal(t *testing.T) {
function TestSummaryIterator (line 29) | func TestSummaryIterator(t *testing.T) {
FILE: logparser/testing/summarize.go
function summarize (line 25) | func summarize(sum *report.Summary, errors ...error) {
function encode (line 38) | func encode(sum *report.Summary) {
function stdout (line 47) | func stdout(sum *report.Summary) {
function errs (line 66) | func errs(errs ...error) (wasErr bool) {
FILE: logparser/v1/main.go
function main (line 20) | func main() {
FILE: logparser/v2/main.go
type result (line 21) | type result struct
type parser (line 28) | type parser struct
function main (line 35) | func main() {
FILE: logparser/v3/main.go
function main (line 19) | func main() {
FILE: logparser/v3/parser.go
type result (line 18) | type result struct
type parser (line 25) | type parser struct
function newParser (line 33) | func newParser() parser {
function parse (line 38) | func parse(p parser, line string) (parsed result, err error) {
function update (line 57) | func update(p parser, parsed result) parser {
FILE: logparser/v4/main.go
function main (line 19) | func main() {
function summarize (line 33) | func summarize(p *parser) {
function dumpErrs (line 46) | func dumpErrs(errs []error) {
FILE: logparser/v4/parser.go
type result (line 18) | type result struct
type parser (line 25) | type parser struct
function newParser (line 34) | func newParser() *parser {
function parse (line 39) | func parse(p *parser, line string) (r result) {
function update (line 64) | func update(p *parser, r result) {
function err (line 85) | func err(p *parser) error {
FILE: logparser/v5/filepipe.go
function fromFile (line 21) | func fromFile(path string) (*pipe.Pipeline, error) {
FILE: logparser/v5/main.go
function main (line 16) | func main() {
FILE: logparser/v5/passthrough.go
type passThrough (line 15) | type passThrough struct
method Consume (line 19) | func (t *passThrough) Consume(results pipe.Iterator) error {
method Each (line 24) | func (t *passThrough) Each(yield func(pipe.Record) error) error {
FILE: logparser/v5/pipe/close.go
function readClose (line 16) | func readClose(r io.Reader) {
FILE: logparser/v5/pipe/filter.go
type Filter (line 16) | type Filter struct
method Consume (line 27) | func (f *Filter) Consume(records Iterator) error {
method Each (line 33) | func (f *Filter) Each(yield func(Record) error) error {
method checkAll (line 45) | func (f *Filter) checkAll(r Record) bool {
function FilterBy (line 22) | func FilterBy(fn ...FilterFunc) *Filter {
FILE: logparser/v5/pipe/filters.go
function NotFilter (line 14) | func NotFilter(filter FilterFunc) FilterFunc {
function DomainExtFilter (line 21) | func DomainExtFilter(domains ...string) FilterFunc {
function DomainFilter (line 33) | func DomainFilter(text string) FilterFunc {
function DomainOrgFilter (line 40) | func DomainOrgFilter(r Record) bool {
FILE: logparser/v5/pipe/group.go
type Group (line 20) | type Group struct
method Consume (line 37) | func (g *Group) Consume(records Iterator) error {
method Each (line 54) | func (g *Group) Each(yield func(Record) error) error {
function GroupBy (line 29) | func GroupBy(key GroupFunc) *Group {
FILE: logparser/v5/pipe/groupers.go
function DomainGrouper (line 15) | func DomainGrouper(r Record) string {
function Page (line 20) | func Page(r Record) string {
FILE: logparser/v5/pipe/jsonlog.go
type JSON (line 17) | type JSON struct
method Each (line 27) | func (j *JSON) Each(yield func(Record) error) error {
function NewJSONLog (line 22) | func NewJSONLog(r io.Reader) *JSON {
FILE: logparser/v5/pipe/jsonreport.go
type JSONReport (line 17) | type JSONReport struct
method Consume (line 27) | func (t *JSONReport) Consume(records Iterator) error {
function NewJSONReport (line 22) | func NewJSONReport(w io.Writer) *JSONReport {
FILE: logparser/v5/pipe/logcount.go
type logCount (line 14) | type logCount struct
method Each (line 21) | func (lc *logCount) Each(yield func(Record) error) error {
method count (line 37) | func (lc *logCount) count() int {
FILE: logparser/v5/pipe/pipe.go
type Iterator (line 12) | type Iterator interface
type Consumer (line 17) | type Consumer interface
type Transform (line 24) | type Transform interface
FILE: logparser/v5/pipe/pipeline.go
type Pipeline (line 18) | type Pipeline struct
method Run (line 39) | func (p *Pipeline) Run() error {
function New (line 25) | func New(src Iterator, dst Consumer, t ...Transform) *Pipeline {
function Default (line 34) | func Default(r io.Reader, w io.Writer, t ...Transform) *Pipeline {
FILE: logparser/v5/pipe/record.go
constant fieldsLength (line 19) | fieldsLength = 4
type record (line 22) | type record struct
method sum (line 38) | func (r record) sum(other record) record {
method UnmarshalText (line 45) | func (r *record) UnmarshalText(p []byte) (err error) {
method UnmarshalJSON (line 65) | func (r *record) UnmarshalJSON(data []byte) error {
method MarshalJSON (line 78) | func (r *record) MarshalJSON() ([]byte, error) {
type recordJSON (line 30) | type recordJSON struct
function parseStr (line 84) | func parseStr(name, v string) (int, error) {
function validate (line 93) | func validate(r record) (err error) {
FILE: logparser/v5/pipe/recordshare.go
type Record (line 20) | type Record struct
method Str (line 25) | func (r Record) Str(field string) string {
method Int (line 30) | func (r Record) Int(field string) int {
method Fields (line 36) | func (r Record) Fields() (fields []string) {
method mustGet (line 50) | func (r Record) mustGet(field string, kind reflect.Kind) reflect.Value {
FILE: logparser/v5/pipe/textlog.go
type TextLog (line 17) | type TextLog struct
method Each (line 27) | func (p *TextLog) Each(yield func(Record) error) error {
function NewTextLog (line 22) | func NewTextLog(r io.Reader) *TextLog {
FILE: logparser/v5/pipe/textreport.go
constant minWidth (line 18) | minWidth = 0
constant tabWidth (line 19) | tabWidth = 4
constant padding (line 20) | padding = 4
constant flags (line 21) | flags = 0
type TextReport (line 25) | type TextReport struct
method Consume (line 35) | func (t *TextReport) Consume(records Iterator) error {
function NewTextReport (line 30) | func NewTextReport(w io.Writer) *TextReport {
FILE: logparser/v6/logly/parse/count.go
type Count (line 14) | type Count struct
method Parse (line 26) | func (c *Count) Parse() bool {
method Err (line 32) | func (c *Count) Err() (err error) {
function CountRecords (line 21) | func CountRecords(p Parser) *Count {
FILE: logparser/v6/logly/parse/json.go
type JSONParser (line 19) | type JSONParser struct
method Parse (line 34) | func (p *JSONParser) Parse() bool {
method Value (line 52) | func (p *JSONParser) Value() record.Record {
method Err (line 57) | func (p *JSONParser) Err() error {
function JSON (line 26) | func JSON(r io.Reader) *JSONParser {
FILE: logparser/v6/logly/parse/parser.go
type Parser (line 14) | type Parser interface
FILE: logparser/v6/logly/parse/text.go
type TextParser (line 19) | type TextParser struct
method Parse (line 34) | func (p *TextParser) Parse() bool {
method Value (line 48) | func (p *TextParser) Value() record.Record {
method Err (line 53) | func (p *TextParser) Err() error {
function Text (line 26) | func Text(r io.Reader) *TextParser {
FILE: logparser/v6/logly/record/json.go
method UnmarshalJSON (line 14) | func (r *Record) UnmarshalJSON(data []byte) error {
FILE: logparser/v6/logly/record/record.go
constant fieldsLength (line 11) | fieldsLength = 4
type Record (line 14) | type Record struct
method Sum (line 22) | func (r *Record) Sum(other Record) {
method Reset (line 28) | func (r *Record) Reset() {
FILE: logparser/v6/logly/record/sum.go
type Sum (line 12) | type Sum struct
method Group (line 24) | func (s *Sum) Group(r Record) {
method Records (line 31) | func (s *Sum) Records() []Record {
function SumGroup (line 17) | func SumGroup() *Sum {
FILE: logparser/v6/logly/record/text.go
method FromText (line 18) | func (r *Record) FromText(p []byte) (err error) {
FILE: logparser/v6/logly/record/validate.go
method validate (line 14) | func (r *Record) validate() error {
FILE: logparser/v6/logly/report/json.go
function JSON (line 19) | func JSON(w io.Writer, rs []record.Record) error {
FILE: logparser/v6/logly/report/text.go
function Text (line 20) | func Text(w io.Writer, rs []record.Record) error {
FILE: logparser/v6/main.go
function main (line 20) | func main() {
FILE: magic/detect.go
function Detect (line 21) | func Detect(format string, filenames []string) (valids []string, err err...
function headerOf (line 42) | func headerOf(format string) string {
function read (line 55) | func read(filename string, buf []byte) error {
FILE: magicpanic/detect.go
function Detect (line 20) | func Detect(format string, filenames []string) (valids []string, err err...
function detect (line 30) | func detect(format string, filenames []string) (valids []string) {
function headerOf (line 46) | func headerOf(format string) string {
function read (line 58) | func read(filename string, buf []byte) error {
FILE: main.go
function main (line 13) | func main() {
FILE: translation/chinese/02-编写第一个程序/main.go
function main (line 32) | func main() {
FILE: translation/chinese/02-编写第一个程序/练习/01-print-names/main.go
function main (line 26) | func main() {
FILE: translation/chinese/02-编写第一个程序/练习/01-print-names/solution/main.go
function main (line 18) | func main() {
FILE: translation/chinese/03-包和作用域/01-packages/bye.go
function bye (line 13) | func bye() {
FILE: translation/chinese/03-包和作用域/01-packages/hey.go
function hey (line 13) | func hey() {
FILE: translation/chinese/03-包和作用域/01-packages/main.go
function main (line 13) | func main() {
FILE: translation/chinese/03-包和作用域/02-scopes/01-scopes/main.go
constant ok (line 15) | ok = true
function main (line 18) | func main() { // 块作用域开始
FILE: translation/chinese/03-包和作用域/02-scopes/02-block-scope/main.go
function nope (line 11) | func nope() { //块作用域开始
function main (line 20) | func main() { // 块作用域开始
FILE: translation/chinese/03-包和作用域/02-scopes/03-nested-scope/main.go
function nested (line 19) | func nested() { // 块作用域开始
function main (line 30) | func main() { // 块作用域开始
FILE: translation/chinese/03-包和作用域/02-scopes/04-package-scope/bye.go
function bye (line 13) | func bye() {
FILE: translation/chinese/03-包和作用域/02-scopes/04-package-scope/hey.go
function hey (line 13) | func hey() {
FILE: translation/chinese/03-包和作用域/02-scopes/04-package-scope/main.go
function main (line 13) | func main() {
FILE: translation/chinese/03-包和作用域/03-importing/01-file-scope/main.go
function main (line 13) | func main() {
FILE: translation/chinese/03-包和作用域/03-importing/02-renaming/main.go
function main (line 14) | func main() {
FILE: translation/chinese/03-包和作用域/练习/01-packages/main.go
function main (line 29) | func main() {
FILE: translation/chinese/03-包和作用域/练习/01-packages/solution/bye.go
function bye (line 13) | func bye() {
FILE: translation/chinese/03-包和作用域/练习/01-packages/solution/greet.go
function greet (line 13) | func greet() {
FILE: translation/chinese/03-包和作用域/练习/01-packages/solution/main.go
function main (line 11) | func main() {
FILE: translation/chinese/03-包和作用域/练习/02-scopes/main.go
function main (line 31) | func main() {
FILE: translation/chinese/03-包和作用域/练习/02-scopes/solution/main.go
function main (line 13) | func main() {
function bye (line 37) | func bye() {
FILE: translation/chinese/03-包和作用域/练习/02-scopes/solution/printer.go
function hello (line 13) | func hello() {
FILE: translation/chinese/03-包和作用域/练习/03-importing/main.go
function main (line 28) | func main() {
FILE: translation/chinese/03-包和作用域/练习/03-importing/solution/main.go
function main (line 15) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/01-statements/01-execution-flow/main.go
function main (line 15) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/01-statements/02-semicolons/main.go
function main (line 15) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/02-expressions/01-operator/main.go
function main (line 15) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/02-expressions/02-call-expression/main.go
function main (line 16) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/03-comments/main.go
function main (line 20) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/练习/01-shy-semicolons/main.go
function main (line 21) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/练习/01-shy-semicolons/solution/main.go
function main (line 11) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/练习/02-naked-expression/main.go
function main (line 20) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/练习/02-naked-expression/solution/main.go
function main (line 11) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/练习/03-operators-combine/main.go
function main (line 24) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/练习/03-operators-combine/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/练习/04-print-go-version/main.go
function main (line 25) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/练习/04-print-go-version/solution/main.go
function main (line 16) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/练习/05-comment-out/main.go
function main (line 22) | func main() {
FILE: translation/chinese/04-语句-表达式-注释/练习/05-comment-out/solution/main.go
function main (line 11) | func main() {
FILE: translation/chinese/05-编写你的第一个库程序包/printer/cmd/main.go
function main (line 14) | func main() {
FILE: translation/chinese/05-编写你的第一个库程序包/printer/printer.go
function Hello (line 14) | func Hello() {
FILE: translation/chinese/05-编写你的第一个库程序包/练习/solution/golang/cmd/main.go
function main (line 17) | func main() {
FILE: translation/chinese/05-编写你的第一个库程序包/练习/solution/golang/go.go
function Version (line 16) | func Version() string {
FILE: translation/chinese/06-变量/01-基础数据类型/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/01-基础数据类型/练习/01-print-the-literals/main.go
function main (line 26) | func main() {
FILE: translation/chinese/06-变量/01-基础数据类型/练习/01-print-the-literals/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/01-基础数据类型/练习/02-print-hexes/main.go
function main (line 45) | func main() {
FILE: translation/chinese/06-变量/01-基础数据类型/练习/02-print-hexes/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/01-声明语法/01-语法/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/01-声明语法/02-命名规则/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/01-声明语法/03-声明顺序/main.go
function main (line 11) | func main() {
FILE: translation/chinese/06-变量/02-声明/02-声明示例/01-int/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/02-声明示例/02-float64/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/02-声明示例/03-bool/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/02-声明示例/04-string/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/03-零值/main.go
function main (line 14) | func main() {
FILE: translation/chinese/06-变量/02-声明/04-未使用的变量和空白标识符/01-未使用的变量/main.go
function main (line 14) | func main() {
FILE: translation/chinese/06-变量/02-声明/04-未使用的变量和空白标识符/02-空白标识符/main.go
function main (line 11) | func main() {
FILE: translation/chinese/06-变量/02-声明/05-多重声明/01-多重声明/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/05-多重声明/02-平行声明/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/06-例子/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/01-int/main.go
function main (line 22) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/01-int/solution/main.go
function main (line 15) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/02-bool/main.go
function main (line 22) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/02-bool/solution/main.go
function main (line 15) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/03-float64/main.go
function main (line 22) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/03-float64/solution/main.go
function main (line 15) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/04-string/main.go
function main (line 22) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/04-string/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/05-undeclarables/main.go
function main (line 28) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/05-undeclarables/solution/main.go
function main (line 11) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/06-with-bits/main.go
function main (line 39) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/06-with-bits/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/07-multiple/main.go
function main (line 28) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/07-multiple/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/08-multiple-2/main.go
function main (line 27) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/08-multiple-2/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/09-unused/main.go
function main (line 24) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/09-unused/solution/main.go
function main (line 11) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/10-package-variable/main.go
function main (line 19) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/10-package-variable/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/11-wrong-doer/main.go
function main (line 22) | func main() {
FILE: translation/chinese/06-变量/02-声明/练习/11-wrong-doer/solution/main.go
function main (line 11) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/01-初始化以及简短声明/01-初始化/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/01-初始化以及简短声明/02-简短声明/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/01-初始化以及简短声明/03-编码示例/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/02-包作用域/main.go
function main (line 28) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/03-多重简短声明/01-声明/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/03-多重简短声明/02-编码示例/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/03-多重简短声明/03-重声明/01/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/03-多重简短声明/03-重声明/02-编码示例/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/04-简短-vs-正常/01-声明/main.go
function main (line 20) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/04-简短-vs-正常/02-简短声明/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/01-short-declare/main.go
function main (line 20) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/01-short-declare/solution/main.go
function main (line 15) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/02-multiple-short-declare/main.go
function main (line 20) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/02-multiple-short-declare/solution/main.go
function main (line 15) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/03-multiple-short-declare-2/main.go
function main (line 23) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/03-multiple-short-declare-2/solution/main.go
function main (line 15) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/04-short-with-expression/main.go
function main (line 22) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/04-short-with-expression/solution/main.go
function main (line 15) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/05-short-discard/main.go
function main (line 28) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/05-short-discard/solution/main.go
function main (line 15) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/06-redeclare/main.go
function main (line 28) | func main() {
FILE: translation/chinese/06-变量/03-简短声明/练习/06-redeclare/solution/main.go
function main (line 15) | func main() {
FILE: translation/chinese/06-变量/04-赋值/01-概述/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/01-赋值/01-赋值/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/01-赋值/02-强类型/main.go
function main (line 18) | func main() {
FILE: translation/chinese/06-变量/04-赋值/01-赋值/03-例子/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/05-多重赋值/main.go
function main (line 16) | func main() {
FILE: translation/chinese/06-变量/04-赋值/06-交换/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/07-路径/main.go
function main (line 16) | func main() {
FILE: translation/chinese/06-变量/04-赋值/08-路径丢弃/main.go
function main (line 16) | func main() {
FILE: translation/chinese/06-变量/04-赋值/09-路径简短声明/main.go
function main (line 16) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/01-make-it-blue/main.go
function main (line 22) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/01-make-it-blue/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/02-vars-to-vars/main.go
function main (line 37) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/02-vars-to-vars/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/03-assign-with-expressions/main.go
function main (line 28) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/03-assign-with-expressions/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/04-find-the-rectangle-perimeter/main.go
function main (line 33) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/04-find-the-rectangle-perimeter/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/05-multi-assign/main.go
function main (line 24) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/05-multi-assign/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/06-multi-assign-2/main.go
function main (line 27) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/06-multi-assign-2/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/07-multi-short-func/main.go
function main (line 29) | func main() {
function multi (line 40) | func multi() (int, int) {
FILE: translation/chinese/06-变量/04-赋值/练习/07-multi-short-func/solution/main.go
function main (line 15) | func main() {
function multi (line 21) | func multi() (int, int) {
FILE: translation/chinese/06-变量/04-赋值/练习/08-swapper/main.go
function main (line 23) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/08-swapper/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/09-swapper-2/main.go
function main (line 22) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/09-swapper-2/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/10-discard-the-file/main.go
function main (line 25) | func main() {
FILE: translation/chinese/06-变量/04-赋值/练习/10-discard-the-file/solution/main.go
function main (line 16) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/01-破坏性的/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/02-正确的/main.go
function main (line 15) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/03-数型转换/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/练习/01-convert-and-fix/main.go
function main (line 20) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/练习/01-convert-and-fix/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/练习/02-convert-and-fix-2/main.go
function main (line 20) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/练习/02-convert-and-fix-2/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/练习/03-convert-and-fix-3/main.go
function main (line 20) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/练习/03-convert-and-fix-3/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/练习/04-convert-and-fix-4/main.go
function main (line 20) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/练习/04-convert-and-fix-4/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/练习/05-convert-and-fix-5/main.go
function main (line 26) | func main() {
FILE: translation/chinese/06-变量/05-类型转换/练习/05-convert-and-fix-5/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/01-演示/main.go
function main (line 19) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/02-版本1/main.go
function main (line 23) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/03-版本2/main.go
function main (line 23) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/练习/01-count-arguments/main.go
function main (line 23) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/练习/01-count-arguments/solution/main.go
function main (line 16) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/练习/02-print-the-path/main.go
function main (line 24) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/练习/02-print-the-path/solution/main.go
function main (line 27) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/练习/03-print-your-name/main.go
function main (line 34) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/练习/03-print-your-name/solution/main.go
function main (line 16) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/练习/04-greet-more-people/main.go
function main (line 30) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/练习/04-greet-more-people/solution/main.go
function main (line 16) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/练习/05-greet-5-people/main.go
function main (line 34) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/练习/05-greet-5-people/solution/main.go
function main (line 16) | func main() {
FILE: translation/chinese/06-变量/06-问候员项目/练习/solution-to-the-lecture-exercise/main.go
function main (line 23) | func main() {
FILE: translation/chinese/07-打印/01-介绍/01-println-vs-printf/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/01-介绍/02/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/02-转义序列/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/03-打印类型/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/04-编程/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/练习/01-print-your-age/main.go
function main (line 23) | func main() {
FILE: translation/chinese/07-打印/练习/01-print-your-age/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/练习/02-print-your-name-and-lastname/main.go
function main (line 24) | func main() {
FILE: translation/chinese/07-打印/练习/02-print-your-name-and-lastname/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/练习/03-false-claims/main.go
function main (line 20) | func main() {
FILE: translation/chinese/07-打印/练习/03-false-claims/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/练习/04-print-the-temperature/main.go
function main (line 24) | func main() {
FILE: translation/chinese/07-打印/练习/04-print-the-temperature/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/练习/05-double-quotes/main.go
function main (line 24) | func main() {
FILE: translation/chinese/07-打印/练习/05-double-quotes/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/练习/06-print-the-type/main.go
function main (line 20) | func main() {
FILE: translation/chinese/07-打印/练习/06-print-the-type/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/练习/07-print-the-type-2/main.go
function main (line 20) | func main() {
FILE: translation/chinese/07-打印/练习/07-print-the-type-2/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/练习/08-print-the-type-3/main.go
function main (line 20) | func main() {
FILE: translation/chinese/07-打印/练习/08-print-the-type-3/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/练习/09-print-the-type-4/main.go
function main (line 19) | func main() {
FILE: translation/chinese/07-打印/练习/09-print-the-type-4/solution/main.go
function main (line 13) | func main() {
FILE: translation/chinese/07-打印/练习/10-print-your-fullname/main.go
function main (line 24) | func main() {
FILE: translation/chinese/07-打印/练习/10-print-your-fullname/solution/main.go
function main (line 16) | func main() {
FILE: translation/spanish/02-tu-primer-programa/ejercicios/01-imprimiendo-nombres/main.go
function main (line 26) | func main() {
FILE: translation/spanish/02-tu-primer-programa/ejercicios/01-imprimiendo-nombres/solucion/main.go
function main (line 18) | func main() {
FILE: translation/spanish/02-tu-primer-programa/main.go
function main (line 32) | func main() {
FILE: translation/spanish/03-paquetes-y-funciones/01-paquetes/bye.go
function bye (line 13) | func bye() {
FILE: translation/spanish/03-paquetes-y-funciones/01-paquetes/hey.go
function hey (line 13) | func hey() {
FILE: translation/spanish/03-paquetes-y-funciones/01-paquetes/main.go
function main (line 13) | func main() {
FILE: translation/spanish/03-paquetes-y-funciones/02-funciones/01-funciones/main.go
constant ok (line 15) | ok = true
function main (line 18) | func main() { // Empieza el bloque de la función
FILE: translation/spanish/03-paquetes-y-funciones/02-funciones/02-bloque-de-funcion/main.go
function nope (line 11) | func nope() { // Empieza el bloque de la función
function main (line 20) | func main() { // Empieza el bloque de la función
FILE: translation/spanish/03-paquetes-y-funciones/02-funciones/03-funciones-anidadas/main.go
function anidado (line 19) | func anidado() { // Empieza el bloque de la función
function main (line 30) | func main() { // Empieza el bloque de la función
FILE: translation/spanish/03-paquetes-y-funciones/02-funciones/04-funcion-del-paquete/bye.go
function bye (line 13) | func bye() {
FILE: translation/spanish/03-paquetes-y-funciones/02-funciones/04-funcion-del-paquete/hey.go
function hey (line 12) | func hey() {
FILE: translation/spanish/03-paquetes-y-funciones/02-funciones/04-funcion-del-paquete/main.go
function main (line 12) | func main() {
FILE: translation/spanish/03-paquetes-y-funciones/03-importando/01-funcion-del-archivo/main.go
function main (line 12) | func main() {
FILE: translation/spanish/03-paquetes-y-funciones/03-importando/02-renombrando/main.go
function main (line 16) | func main() {
FILE: translation/spanish/03-paquetes-y-funciones/ejercicios/01-paquetes/main.go
function main (line 31) | func main() {
FILE: translation/spanish/03-paquetes-y-funciones/ejercicios/01-paquetes/solucion/bye.go
function bye (line 13) | func bye() {
FILE: translation/spanish/03-paquetes-y-funciones/ejercicios/01-paquetes/solucion/greet.go
function greet (line 13) | func greet() {
FILE: translation/spanish/03-paquetes-y-funciones/ejercicios/01-paquetes/solucion/main.go
function main (line 11) | func main() {
FILE: translation/spanish/03-paquetes-y-funciones/ejercicios/02-scopes/main.go
function main (line 30) | func main() {
FILE: translation/spanish/03-paquetes-y-funciones/ejercicios/02-scopes/solucion/main.go
function main (line 13) | func main() {
function bye (line 37) | func bye() {
FILE: translation/spanish/03-paquetes-y-funciones/ejercicios/02-scopes/solucion/printer.go
function hello (line 13) | func hello() {
FILE: translation/spanish/03-paquetes-y-funciones/ejercicios/03-importando/main.go
function main (line 27) | func main() {
FILE: translation/spanish/03-paquetes-y-funciones/ejercicios/03-importando/solucion/main.go
function main (line 18) | func main() {
FILE: x-tba/foundations/01-print-args/01-printf/main.go
function main (line 13) | func main() {
FILE: x-tba/foundations/01-print-args/main.go
function main (line 16) | func main() {
FILE: x-tba/foundations/02-variables/01-basics/main.go
function main (line 16) | func main() {
FILE: x-tba/foundations/02-variables/02-short-discard/main.go
function main (line 19) | func main() {
FILE: x-tba/foundations/02-variables/03-conversion/main.go
function main (line 13) | func main() {
FILE: x-tba/foundations/02-variables/types/main.go
function main (line 19) | func main() {
FILE: x-tba/foundations/03-if-switch-loop/01-for-crunch-the-primes/main.go
function main (line 19) | func main() {
FILE: x-tba/foundations/03-if-switch-loop/02-switch-months/main.go
function main (line 18) | func main() {
FILE: x-tba/foundations/03-if-switch-loop/03-math-table-if-switch-loop/main.go
constant validOps (line 19) | validOps = "* / + - mul div add sub"
constant usageMsg (line 20) | usageMsg = "Usage: [valid ops: " + validOps + "] [size]"
constant sizeMissingMsg (line 21) | sizeMissingMsg = "Size is missing\n" + usageMsg
constant invalidOpMsg (line 22) | invalidOpMsg = `Invalid operator.
function main (line 26) | func main() {
FILE: x-tba/foundations/03-if-switch-loop/04-lucky-number-if-for-switch/main.go
constant maxTurns (line 20) | maxTurns = 5
constant usage (line 21) | usage = `Welcome to the Lucky Number Game! 🍀
function main (line 34) | func main() {
FILE: x-tba/foundations/03-if-switch-loop/05-path-searcher-for-range/main.go
function main (line 18) | func main() {
FILE: x-tba/foundations/area-of-a-circle/main.go
function main (line 16) | func main() {
FILE: x-tba/foundations/calc/01-shortdecl-int-conv/main.go
function main (line 17) | func main() {
FILE: x-tba/foundations/calc/02-if/main.go
function main (line 17) | func main() {
FILE: x-tba/foundations/calc/03-floats-conv/main.go
function main (line 17) | func main() {
FILE: x-tba/foundations/calc/04-error-handling/main.go
function main (line 17) | func main() {
FILE: x-tba/foundations/calc/05-switch/main.go
function main (line 17) | func main() {
FILE: x-tba/foundations/calc/06-switch/main.go
function main (line 17) | func main() {
FILE: x-tba/foundations/calc/07/main.go
function main (line 17) | func main() {
FILE: x-tba/foundations/calc/08-funcs/main.go
function main (line 18) | func main() {
function parse (line 51) | func parse(snum string) (n float64, err error) {
function calc (line 59) | func calc(a, b float64, op string) (res float64, err error) {
FILE: x-tba/foundations/calc/09-packages/calc/calc.go
function Parse (line 17) | func Parse(snum string) (n float64, err error) {
function Do (line 28) | func Do(a, b float64, op string) (res float64, err error) {
FILE: x-tba/foundations/calc/09-packages/main.go
function main (line 18) | func main() {
FILE: x-tba/foundations/calc/calc-scanner/main.go
function main (line 27) | func main() {
FILE: x-tba/foundations/cels-to-fahr/main.go
function main (line 13) | func main() {
FILE: x-tba/foundations/counter/main.go
function main (line 16) | func main() {
FILE: x-tba/foundations/feet-to-meters/main.go
function main (line 17) | func main() {
FILE: x-tba/foundations/lookup/main.go
constant missingHost (line 19) | missingHost = "Please provide at least one domain. --help for more infor...
constant help (line 21) | help = `
function main (line 33) | func main() {
FILE: x-tba/foundations/volume-of-a-sphere/main.go
function main (line 18) | func main() {
FILE: x-tba/project-png-parser/png-parser-project/main.go
function main (line 20) | func main() {
function report (line 94) | func report() {
FILE: x-tba/slicing-allocs-gotcha/main.go
constant loops (line 25) | loops = 1000
constant file (line 26) | file = "nums.txt"
function main (line 31) | func main() {
function report (line 51) | func report() {
function init (line 68) | func init() {
FILE: x-tba/slicing-allocs-gotcha/nums/main.go
function main (line 17) | func main() {
FILE: x-tba/swapi-api-client/fetch/main.go
constant base (line 19) | base = "https://swapi.co/api/"
function main (line 21) | func main() {
FILE: x-tba/swapi-api-client/film.go
type Film (line 19) | type Film struct
method String (line 26) | func (f Film) String() string {
function fetchFilm (line 38) | func fetchFilm(ctx context.Context, id int) (film Film, err error) {
FILE: x-tba/swapi-api-client/main.go
constant timeout (line 47) | timeout = 10 * time.Second
function main (line 49) | func main() {
function quit (line 77) | func quit(message string, cond interface{}) {
FILE: x-tba/swapi-api-client/request.go
constant MaxResponseSize (line 20) | MaxResponseSize = 2 << 16
function request (line 23) | func request(ctx context.Context, url string) ([]byte, error) {
FILE: x-tba/swapi-api-client/starship.go
type Starship (line 21) | type Starship struct
method String (line 28) | func (ship Starship) String() string {
function fetchStarships (line 38) | func fetchStarships(ctx context.Context, shipUrls []string, ships []Star...
function fetchStarship (line 63) | func fetchStarship(ctx context.Context, id int) (ship Starship, err erro...
FILE: x-tba/swapi-api-client/swapi.go
constant swapi (line 11) | swapi = "https://swapi.co/api/"
FILE: x-tba/tictactoe-experiments/00-without-bufio/main.go
constant maxTurn (line 21) | maxTurn = 9
constant empty (line 24) | empty = " "
constant player1 (line 25) | player1 = " X "
constant player2 (line 26) | player2 = " O "
constant header (line 27) | header = "---+---+---"
constant footer (line 28) | footer = "---+---+---"
constant separator (line 29) | separator = "|"
constant banner (line 31) | banner = `
function main (line 53) | func main() {
FILE: x-tba/tictactoe-experiments/01-without-funcs/main.go
constant maxTurn (line 23) | maxTurn = 9
constant empty (line 26) | empty = " "
constant player1 (line 27) | player1 = " X "
constant player2 (line 28) | player2 = " O "
constant header (line 29) | header = "---+---+---"
constant footer (line 30) | footer = "---+---+---"
constant separator (line 31) | separator = "|"
constant banner (line 33) | banner = `
function main (line 58) | func main() {
FILE: x-tba/tictactoe-experiments/02-with-funcs/main.go
constant emptyMark (line 21) | emptyMark = "☆"
constant mark1 (line 22) | mark1 = "💀"
constant mark2 (line 23) | mark2 = "🎈"
constant banner (line 24) | banner = `
constant maxTurn (line 29) | maxTurn = 9
function main (line 32) | func main() {
function loop (line 38) | func loop(in *bufio.Scanner) {
function createBoard (line 69) | func createBoard() [][]string {
function prompt (line 77) | func prompt(board [][]string, player string) {
function printBoard (line 82) | func printBoard(board [][]string, player string) {
function getMove (line 91) | func getMove(move string) int {
function play (line 98) | func play(board [][]string, player string, pos int) string {
function finito (line 124) | func finito(board [][]string, turn int, player string) string {
function won (line 134) | func won(board [][]string) (won bool) {
function switchTo (line 159) | func switchTo(player string) string {
FILE: x-tba/tictactoe-experiments/03-with-structs/main.go
constant emptyMark (line 21) | emptyMark = "☆"
constant mark1 (line 22) | mark1 = "💀"
constant mark2 (line 23) | mark2 = "🎈"
constant banner (line 24) | banner = `
constant maxTurn (line 29) | maxTurn = 9
type game (line 32) | type game struct
function main (line 38) | func main() {
function loop (line 44) | func loop(in *bufio.Scanner) {
function createBoard (line 74) | func createBoard() [][]string {
function prompt (line 82) | func prompt(g game) {
function printBoard (line 87) | func printBoard(board [][]string) {
function getMove (line 96) | func getMove(move string) int {
function play (line 104) | func play(g game, pos int) string {
function finito (line 130) | func finito(g game) string {
function won (line 140) | func won(board [][]string) (won bool) {
function switchTo (line 165) | func switchTo(player string) string {
FILE: x-tba/tictactoe-experiments/04-with-methods/main.go
constant emptyMark (line 21) | emptyMark = "☆"
constant mark1 (line 22) | mark1 = "💀"
constant mark2 (line 23) | mark2 = "🎈"
constant banner (line 24) | banner = `
constant maxTurn (line 29) | maxTurn = 9
function main (line 32) | func main() {
type game (line 38) | type game struct
method prompt (line 86) | func (g game) prompt() {
method print (line 91) | func (g game) print() {
method play (line 100) | func (g game) play(pos int) string {
method finito (line 126) | func (g game) finito() string {
method won (line 136) | func (g game) won() (won bool) {
function loop (line 44) | func loop(in *bufio.Scanner) {
function newGame (line 75) | func newGame() game {
function switchTo (line 161) | func switchTo(player string) string {
FILE: x-tba/tictactoe-experiments/05-with-pointers/main.go
function main (line 19) | func main() {
constant emptyMark (line 30) | emptyMark = "☆"
constant mark1 (line 31) | mark1 = "💀"
constant mark2 (line 32) | mark2 = "🎈"
constant maxTurn (line 34) | maxTurn = 9
type game (line 37) | type game struct
method prompt (line 85) | func (g *game) prompt() {
method String (line 89) | func (g *game) String() string {
method play (line 105) | func (g *game) play(pos int) string {
method finito (line 131) | func (g *game) finito() string {
method won (line 143) | func (g *game) won() (won bool) {
method next (line 168) | func (g *game) next() {
function loop (line 45) | func loop(in *bufio.Scanner) {
function newGame (line 74) | func newGame() *game {
FILE: x-tba/tictactoe-experiments/06-refactor/game.go
type state (line 15) | type state
constant maxTurn (line 18) | maxTurn = 9
constant wrongPosition (line 20) | wrongPosition = -2
constant statePlaying (line 22) | statePlaying state = iota
constant stateWon (line 23) | stateWon
constant stateTie (line 24) | stateTie
constant stateAlreadyPlayed (line 26) | stateAlreadyPlayed
constant stateWrongPosition (line 27) | stateWrongPosition
type game (line 30) | type game struct
method play (line 53) | func (g *game) play(pos int) state {
method move (line 73) | func (g *game) move(pos int) state {
method won (line 91) | func (g *game) won() (won bool) {
method changePlayer (line 118) | func (g *game) changePlayer() {
method print (line 126) | func (g *game) print() {
function newGame (line 40) | func newGame(s skin, l logger) *game {
function position (line 147) | func position(pos int) (row, col int) {
FILE: x-tba/tictactoe-experiments/06-refactor/logger.go
type logger (line 11) | type logger struct
method Print (line 17) | func (l logger) Print(args ...interface{}) {
method Printf (line 21) | func (l logger) Printf(fmt string, args ...interface{}) {
method Println (line 25) | func (l logger) Println(args ...interface{}) {
FILE: x-tba/tictactoe-experiments/06-refactor/main.go
function main (line 23) | func main() {
function announce (line 72) | func announce(g *game, st state) {
function selectSkin (line 88) | func selectSkin(in *bufio.Scanner) skin {
FILE: x-tba/tictactoe-experiments/06-refactor/skins.go
type skin (line 14) | type skin struct
FILE: x-tba/tictactoe/00-print/main.go
function main (line 18) | func main() {
FILE: x-tba/tictactoe/01-vars/main.go
function main (line 18) | func main() {
FILE: x-tba/tictactoe/02-short-decl/main.go
function main (line 18) | func main() {
FILE: x-tba/tictactoe/03-consts/main.go
function main (line 18) | func main() {
FILE: x-tba/tictactoe/04-funcs/main.go
constant banner (line 20) | banner = `
constant maxTurns (line 31) | maxTurns = 9
function main (line 39) | func main() {
function printBoard (line 46) | func printBoard() {
function printStatus (line 53) | func printStatus() {
FILE: x-tba/tictactoe/05-testing/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
FILE: x-tba/tictactoe/05-testing/main.go
constant banner (line 20) | banner = `
constant maxTurns (line 31) | maxTurns = 9
function main (line 39) | func main() {
function printBoard (line 46) | func printBoard() {
function printStatus (line 53) | func printStatus() {
FILE: x-tba/tictactoe/06-if-switch/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
FILE: x-tba/tictactoe/06-if-switch/main.go
constant banner (line 20) | banner = `
constant maxTurns (line 31) | maxTurns = 9
function main (line 39) | func main() {
function printBoard (line 47) | func printBoard() {
function printStatus (line 54) | func printStatus() {
function printEnding (line 63) | func printEnding() {
FILE: x-tba/tictactoe/07-loop/board.go
function printBoard (line 14) | func printBoard() {
FILE: x-tba/tictactoe/07-loop/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
FILE: x-tba/tictactoe/07-loop/main.go
constant maxTurns (line 19) | maxTurns = 9
function main (line 27) | func main() {
function printStatus (line 39) | func printStatus() {
function printEnding (line 48) | func printEnding() {
function switchPlayer (line 62) | func switchPlayer() {
FILE: x-tba/tictactoe/07-loop/skin.go
constant banner (line 12) | banner = `
constant player1 (line 18) | player1, player2 = "X", "O"
constant sepHeader (line 20) | sepHeader = `/---+---+---\`
constant sepLine (line 21) | sepLine = `+---+---+---+`
constant sepFooter (line 22) | sepFooter = `\---+---+---/`
constant sepCell (line 23) | sepCell = "|"
FILE: x-tba/tictactoe/08-multi-loop/board.go
function printBoard (line 14) | func printBoard() {
FILE: x-tba/tictactoe/08-multi-loop/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
FILE: x-tba/tictactoe/08-multi-loop/main.go
constant maxTurns (line 19) | maxTurns = 9
function main (line 27) | func main() {
function printStatus (line 39) | func printStatus() {
function printEnding (line 48) | func printEnding() {
function switchPlayer (line 63) | func switchPlayer() {
FILE: x-tba/tictactoe/08-multi-loop/skin.go
constant banner (line 12) | banner = `
constant player1 (line 18) | player1, player2 = "X", "O"
constant sepHeader (line 20) | sepHeader = `/---+---+---\`
constant sepLine (line 21) | sepLine = `+---+---+---+`
constant sepFooter (line 22) | sepFooter = `\---+---+---/`
constant sepCell (line 23) | sepCell = "|"
FILE: x-tba/tictactoe/09-slices/board.go
function printBoard (line 14) | func printBoard() {
FILE: x-tba/tictactoe/09-slices/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
function ExamplePrintBoardCells (line 32) | func ExamplePrintBoardCells() {
FILE: x-tba/tictactoe/09-slices/init.go
function initCells (line 12) | func initCells() {
FILE: x-tba/tictactoe/09-slices/main.go
constant maxTurns (line 19) | maxTurns = 9
function main (line 28) | func main() {
function printStatus (line 42) | func printStatus() {
function printEnding (line 51) | func printEnding() {
FILE: x-tba/tictactoe/09-slices/play.go
function play (line 15) | func play() {
function switchPlayer (line 39) | func switchPlayer() {
FILE: x-tba/tictactoe/09-slices/skin.go
constant banner (line 12) | banner = `
constant player1 (line 18) | player1, player2 = "X", "O"
constant emptyCell (line 19) | emptyCell = " "
constant sepHeader (line 21) | sepHeader = `/---+---+---\`
constant sepLine (line 22) | sepLine = `+---+---+---+`
constant sepFooter (line 23) | sepFooter = `\---+---+---/`
constant sepCell (line 24) | sepCell = "|"
FILE: x-tba/tictactoe/10-arrays/board.go
function printBoard (line 14) | func printBoard() {
FILE: x-tba/tictactoe/10-arrays/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
function ExamplePrintBoardCells (line 32) | func ExamplePrintBoardCells() {
FILE: x-tba/tictactoe/10-arrays/init.go
function initCells (line 12) | func initCells() {
FILE: x-tba/tictactoe/10-arrays/main.go
constant maxTurns (line 19) | maxTurns = 9
function main (line 28) | func main() {
function printStatus (line 42) | func printStatus() {
function printEnding (line 51) | func printEnding() {
FILE: x-tba/tictactoe/10-arrays/play.go
function play (line 15) | func play() {
function switchPlayer (line 39) | func switchPlayer() {
FILE: x-tba/tictactoe/10-arrays/skin.go
constant banner (line 12) | banner = `
constant player1 (line 18) | player1, player2 = "X", "O"
constant emptyCell (line 19) | emptyCell = " "
constant sepHeader (line 21) | sepHeader = `/---+---+---\`
constant sepLine (line 22) | sepLine = `+---+---+---+`
constant sepFooter (line 23) | sepFooter = `\---+---+---/`
constant sepCell (line 24) | sepCell = "|"
FILE: x-tba/tictactoe/11-randomization/board.go
function printBoard (line 14) | func printBoard() {
FILE: x-tba/tictactoe/11-randomization/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
function ExamplePrintBoardCells (line 31) | func ExamplePrintBoardCells() {
FILE: x-tba/tictactoe/11-randomization/init.go
function init (line 18) | func init() {
function initCells (line 24) | func initCells() {
FILE: x-tba/tictactoe/11-randomization/main.go
constant maxTurns (line 19) | maxTurns = 9
function main (line 31) | func main() {
function wait (line 45) | func wait() {
function printStatus (line 52) | func printStatus() {
function printEnding (line 61) | func printEnding() {
FILE: x-tba/tictactoe/11-randomization/play.go
function play (line 17) | func play() {
function switchPlayer (line 49) | func switchPlayer() {
FILE: x-tba/tictactoe/11-randomization/skin.go
constant banner (line 12) | banner = `
constant player1 (line 18) | player1, player2 = "X", "O"
constant emptyCell (line 19) | emptyCell = " "
constant sepHeader (line 21) | sepHeader = `/---+---+---\`
constant sepLine (line 22) | sepLine = `+---+---+---+`
constant sepFooter (line 23) | sepFooter = `\---+---+---/`
constant sepCell (line 24) | sepCell = "|"
FILE: x-tba/tictactoe/12-infinite-loop/board.go
function printBoard (line 14) | func printBoard() {
FILE: x-tba/tictactoe/12-infinite-loop/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
function ExamplePrintBoardCells (line 31) | func ExamplePrintBoardCells() {
FILE: x-tba/tictactoe/12-infinite-loop/init.go
function init (line 18) | func init() {
function initCells (line 24) | func initCells() {
FILE: x-tba/tictactoe/12-infinite-loop/main.go
constant maxTurns (line 19) | maxTurns = 9
function main (line 31) | func main() {
function wait (line 68) | func wait() {
function printStatus (line 75) | func printStatus() {
FILE: x-tba/tictactoe/12-infinite-loop/play.go
function play (line 17) | func play() {
function switchPlayer (line 49) | func switchPlayer() {
FILE: x-tba/tictactoe/12-infinite-loop/skin.go
constant banner (line 12) | banner = `
constant player1 (line 18) | player1, player2 = "X", "O"
constant emptyCell (line 19) | emptyCell = " "
constant sepHeader (line 21) | sepHeader = `/---+---+---\`
constant sepLine (line 22) | sepLine = `+---+---+---+`
constant sepFooter (line 23) | sepFooter = `\---+---+---/`
constant sepCell (line 24) | sepCell = "|"
FILE: x-tba/tictactoe/13-detect-winning/board.go
function printBoard (line 14) | func printBoard() {
FILE: x-tba/tictactoe/13-detect-winning/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
function ExamplePrintBoardCells (line 31) | func ExamplePrintBoardCells() {
FILE: x-tba/tictactoe/13-detect-winning/ending.go
function checkWinOrTie (line 23) | func checkWinOrTie() {
FILE: x-tba/tictactoe/13-detect-winning/init.go
function init (line 18) | func init() {
function initCells (line 24) | func initCells() {
FILE: x-tba/tictactoe/13-detect-winning/main.go
constant maxTurns (line 19) | maxTurns = 9
function main (line 34) | func main() {
function nextTurn (line 51) | func nextTurn() bool {
function wait (line 118) | func wait() {
function printStatus (line 125) | func printStatus() {
FILE: x-tba/tictactoe/13-detect-winning/play.go
function play (line 17) | func play() {
function switchPlayer (line 38) | func switchPlayer() {
FILE: x-tba/tictactoe/13-detect-winning/skin.go
constant banner (line 12) | banner = `
constant player1 (line 18) | player1, player2 = "X", "O"
constant emptyCell (line 19) | emptyCell = " "
constant sepHeader (line 21) | sepHeader = `/---+---+---\`
constant sepLine (line 22) | sepLine = `+---+---+---+`
constant sepFooter (line 23) | sepFooter = `\---+---+---/`
constant sepCell (line 24) | sepCell = "|"
FILE: x-tba/tictactoe/14-more-tests/board.go
function printBoard (line 14) | func printBoard() {
FILE: x-tba/tictactoe/14-more-tests/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
function ExamplePrintBoardCells (line 31) | func ExamplePrintBoardCells() {
FILE: x-tba/tictactoe/14-more-tests/ending.go
function checkWinOrTie (line 23) | func checkWinOrTie() {
FILE: x-tba/tictactoe/14-more-tests/ending_test.go
function TestWin (line 13) | func TestWin(t *testing.T) {
function TestTie (line 42) | func TestTie(t *testing.T) {
FILE: x-tba/tictactoe/14-more-tests/init.go
function init (line 18) | func init() {
function initCells (line 24) | func initCells() {
FILE: x-tba/tictactoe/14-more-tests/main.go
constant maxTurns (line 19) | maxTurns = 9
function main (line 32) | func main() {
function nextTurn (line 43) | func nextTurn() bool {
function wait (line 72) | func wait() {
function printStatus (line 79) | func printStatus() {
FILE: x-tba/tictactoe/14-more-tests/play.go
function play (line 17) | func play() {
function switchPlayer (line 38) | func switchPlayer() {
FILE: x-tba/tictactoe/14-more-tests/play_test.go
function TestWrongMove (line 13) | func TestWrongMove(t *testing.T) {
FILE: x-tba/tictactoe/14-more-tests/skin.go
constant banner (line 12) | banner = `
constant player1 (line 18) | player1, player2 = "X", "O"
constant emptyCell (line 19) | emptyCell = " "
constant sepHeader (line 21) | sepHeader = `/---+---+---\`
constant sepLine (line 22) | sepLine = `+---+---+---+`
constant sepFooter (line 23) | sepFooter = `\---+---+---/`
constant sepCell (line 24) | sepCell = "|"
FILE: x-tba/tictactoe/15-os-args/board.go
function printBoard (line 14) | func printBoard() {
FILE: x-tba/tictactoe/15-os-args/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
function ExamplePrintBoardCells (line 31) | func ExamplePrintBoardCells() {
FILE: x-tba/tictactoe/15-os-args/ending.go
function checkWinOrTie (line 23) | func checkWinOrTie() {
FILE: x-tba/tictactoe/15-os-args/ending_test.go
function TestWin (line 13) | func TestWin(t *testing.T) {
function TestTie (line 42) | func TestTie(t *testing.T) {
FILE: x-tba/tictactoe/15-os-args/init.go
function init (line 21) | func init() {
function initCells (line 27) | func initCells() {
function setGameSpeed (line 33) | func setGameSpeed() {
FILE: x-tba/tictactoe/15-os-args/main.go
constant maxTurns (line 23) | maxTurns = 9
constant defaultGameSpeed (line 24) | defaultGameSpeed = time.Second * 2
function main (line 40) | func main() {
function wait (line 50) | func wait() {
FILE: x-tba/tictactoe/15-os-args/play.go
function play (line 17) | func play() {
function switchPlayer (line 38) | func switchPlayer() {
FILE: x-tba/tictactoe/15-os-args/play_test.go
function TestWrongMove (line 13) | func TestWrongMove(t *testing.T) {
FILE: x-tba/tictactoe/15-os-args/skin.go
constant banner (line 12) | banner = `
constant player1 (line 18) | player1, player2 = "X", "O"
constant emptyCell (line 19) | emptyCell = " "
constant sepHeader (line 21) | sepHeader = `/---+---+---\`
constant sepLine (line 22) | sepLine = `+---+---+---+`
constant sepFooter (line 23) | sepFooter = `\---+---+---/`
constant sepCell (line 24) | sepCell = "|"
FILE: x-tba/tictactoe/15-os-args/turn.go
function nextTurn (line 15) | func nextTurn() bool {
function printStatus (line 46) | func printStatus() {
FILE: x-tba/tictactoe/16-types/board.go
function printBoard (line 14) | func printBoard() {
FILE: x-tba/tictactoe/16-types/board_test.go
function ExamplePrintBoard (line 14) | func ExamplePrintBoard() {
function ExamplePrintBoardCells (line 31) | func ExamplePrintBoardCells() {
FILE: x-tba/tictactoe/16-types/ending.go
function checkWinOrTie (line 23) | func checkWinOrTie() {
FILE: x-tba/tictactoe/16-types/ending_test.go
function TestWin (line 13) | func TestWin(t *testing.T) {
function TestTie (line 42) | func TestTie(t *testing.T) {
FILE: x-tba/tictactoe/16-types/init.go
function init (line 21) | func init() {
function initCells (line 27) | func initCells() {
function setGameSpeed (line 33) | func setGameSpeed() {
FILE: x-tba/tictactoe/16-types/main.go
constant maxTurns (line 23) | maxTurns = 9
constant defaultGameSpeed (line 24) | defaultGameSpeed = time.Second * 2
function main (line 40) | func main() {
function wait (line 50) | func wait() {
FILE: x-tba/tictactoe/16-types/play.go
function play (line 17) | func play() {
function switchPlayer (line 38) | func switchPlayer() {
FILE: x-tba/tictactoe/16-types/play_test.go
function TestWrongMove (line 13) | func TestWrongMove(t *testing.T) {
FILE: x-tba/tictactoe/16-types/skin.go
type cell (line 12) | type cell
constant banner (line 16) | banner = `
constant player1 (line 21) | player1, player2, emptyCell cell = "X", "O", " "
constant sepHeader (line 23) | sepHeader = `/---+---+---\`
constant sepLine (line 24) | sepLine = `+---+---+---+`
constant sepFooter (line 25) | sepFooter = `\---+---+---/`
constant sepCell (line 26) | sepCell = "|"
FILE: x-tba/tictactoe/16-types/turn.go
function nextTurn (line 15) | func nextTurn() bool {
function printStatus (line 46) | func printStatus() {
FILE: x-tba/wizards-structs/marshal/main.go
type Wizard (line 17) | type Wizard struct
function main (line 24) | func main() {
FILE: x-tba/wizards-structs/server/main.go
function main (line 16) | func main() {
function add (line 22) | func add(w http.ResponseWriter, r *http.Request) {
function list (line 32) | func list(w http.ResponseWriter, r *http.Request) {
function onlyPost (line 38) | func onlyPost(next http.HandlerFunc) http.HandlerFunc {
FILE: x-tba/wizards-structs/server/store.go
type wizard (line 13) | type wizard struct
type storage (line 19) | type storage struct
method add (line 24) | func (db *storage) add(w wizard) {
method list (line 30) | func (db *storage) list() []wizard {
function init (line 38) | func init() {
FILE: x-tba/wizards-structs/server/templates.go
function init (line 15) | func init() {
FILE: x-tba/wizards-structs/unmarshal/main.go
type Wizard (line 19) | type Wizard struct
function main (line 26) | func main() {
Condensed preview — 1533 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,874K chars).
[
{
"path": ".gitignore",
"chars": 215,
"preview": "*.DS_Store\n\n# Binaries for programs and plugins\n*.exe\n*.exe~\n*.dll\n*.so\n*.dylib\n\n# Test binary, build with `go test -c`\n"
},
{
"path": "01-get-started/README.md",
"chars": 223,
"preview": "# GO INSTALLATION GUIDES\n\nPlease select your operating system below for the detailed installation instructions:\n\n* [OS X"
},
{
"path": "01-get-started/osx-installation.md",
"chars": 1739,
"preview": "# OS X INSTALLATION CHEATSHEET\n\n## NOTE\n\nIf you have [homebrew](https://brew.sh) installed, you can easily install Go li"
},
{
"path": "01-get-started/programmers-roadmap.md",
"chars": 6934,
"preview": "# PROGRAMMER'S ROADMAP\n\nHi!\n\nIf you're an experienced developer, you may want to watch only the following lectures. If y"
},
{
"path": "01-get-started/ubuntu-installation.md",
"chars": 2527,
"preview": "# Linux Installation Cheatsheet\n\nIf you want to use snap, you can easily install Go like so:\n\n sudo snap install go -"
},
{
"path": "01-get-started/windows-installation.md",
"chars": 2814,
"preview": "# WINDOWS INSTALLATION CHEATSHEET\n\n## NOTE\n\nIf you have [chocolatey.org](https://chocolatey.org/) package manager, you c"
},
{
"path": "02-write-your-first-program/README.md",
"chars": 1679,
"preview": "# Cheatsheet: Write your First Go Program\n\nHi!\n\nFor reference, you can store this cheatsheet after you take the lectures"
},
{
"path": "02-write-your-first-program/annotated-go-program-example.md",
"chars": 1428,
"preview": "# Annotated Example Go Program\n\n```go\n// package main is a special package\n// it allows Go to create an executable file\n"
},
{
"path": "02-write-your-first-program/exercises/01-print-names/main.go",
"chars": 722,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "02-write-your-first-program/exercises/01-print-names/solution/main.go",
"chars": 443,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "02-write-your-first-program/exercises/README.md",
"chars": 2133,
"preview": "1. **Print your name and your best friend's name** using Println twice. [Check out this exercise here](https://github.co"
},
{
"path": "02-write-your-first-program/main.go",
"chars": 1572,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "02-write-your-first-program/questions/01-gopath/README.md",
"chars": 506,
"preview": "## Where should you save your Go source code?\n* Anywhere on my computer\n* Under $GOPATH\n* Under $GOPATH/src *CORRECT*\n\n#"
},
{
"path": "02-write-your-first-program/questions/02-code-your-first-program/README.md",
"chars": 4528,
"preview": "## Which keyword below that you need use to define a package?\n```go\npackage main\n\nfunc main() {\n}\n```\n1. func\n2. package"
},
{
"path": "02-write-your-first-program/questions/03-run-your-first-program/README.md",
"chars": 1561,
"preview": "## What is the difference between `go build` and `go run`?\n1. `go run` just compiles a program; whereas `go build` both "
},
{
"path": "03-packages-and-scopes/01-packages/bye.go",
"chars": 371,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/01-packages/hey.go",
"chars": 371,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/01-packages/main.go",
"chars": 597,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/02-scopes/01-scopes/main.go",
"chars": 540,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/02-scopes/02-block-scope/main.go",
"chars": 607,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/02-scopes/03-nested-scope/main.go",
"chars": 996,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/02-scopes/04-package-scope/bye.go",
"chars": 371,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/02-scopes/04-package-scope/hey.go",
"chars": 371,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/02-scopes/04-package-scope/main.go",
"chars": 916,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/03-importing/01-file-scope/bye.go",
"chars": 576,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/03-importing/01-file-scope/main.go",
"chars": 374,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/03-importing/02-renaming/main.go",
"chars": 410,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/exercises/01-packages/main.go",
"chars": 877,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/exercises/01-packages/solution/bye.go",
"chars": 374,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/exercises/01-packages/solution/greet.go",
"chars": 377,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/exercises/01-packages/solution/main.go",
"chars": 353,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/exercises/02-scopes/main.go",
"chars": 962,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/exercises/02-scopes/solution/main.go",
"chars": 952,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/exercises/02-scopes/solution/printer.go",
"chars": 528,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/exercises/03-importing/main.go",
"chars": 682,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/exercises/03-importing/solution/main.go",
"chars": 440,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "03-packages-and-scopes/exercises/README.md",
"chars": 548,
"preview": "1. **[Use your own package](https://github.com/inancgumus/learngo/tree/master/03-packages-and-scopes/exercises/01-packag"
},
{
"path": "03-packages-and-scopes/questions/01-packages-A/README.md",
"chars": 1319,
"preview": "## Where to store the source code files that belong to a package?\n1. Each file should go into a different directory\n2. I"
},
{
"path": "03-packages-and-scopes/questions/02-packages-B/README.md",
"chars": 1021,
"preview": "## Which one below is a correct package type in Go?\n* Empty package\n* Executable package *CORRECT*\n* Transferrable packa"
},
{
"path": "03-packages-and-scopes/questions/03-scopes/README.md",
"chars": 3573,
"preview": "## What's a scope?\n* Executable block of code\n* The visibility of the declared names **CORRECT**\n* Determines what to ru"
},
{
"path": "04-statements-expressions-comments/01-statements/01-execution-flow/main.go",
"chars": 513,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/01-statements/02-semicolons/main.go",
"chars": 401,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/02-expressions/01-operator/main.go",
"chars": 385,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/02-expressions/02-call-expression/main.go",
"chars": 444,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/03-comments/main.go",
"chars": 608,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/exercises/01-shy-semicolons/main.go",
"chars": 616,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/exercises/01-shy-semicolons/solution/main.go",
"chars": 737,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/exercises/02-naked-expression/main.go",
"chars": 596,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/exercises/02-naked-expression/solution/main.go",
"chars": 620,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/exercises/03-operators-combine/main.go",
"chars": 728,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/exercises/03-operators-combine/solution/main.go",
"chars": 483,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/exercises/04-print-go-version/main.go",
"chars": 742,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/exercises/04-print-go-version/solution/main.go",
"chars": 399,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/exercises/05-comment-out/main.go",
"chars": 717,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/exercises/05-comment-out/solution/main.go",
"chars": 433,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "04-statements-expressions-comments/exercises/06-use-godoc/exercise.md",
"chars": 191,
"preview": "## EXERCISE\n\n- Print the documentation of `runtime.NumCPU` function in the command line\n- Print also its source code usi"
},
{
"path": "04-statements-expressions-comments/exercises/06-use-godoc/solution/solution.md",
"chars": 90,
"preview": "## DOCUMENTATION:\n\n go doc runtime NumCPU\n\n## SOURCE CODE:\n\n go doc -src runtime NumCPU\n"
},
{
"path": "04-statements-expressions-comments/exercises/README.md",
"chars": 1198,
"preview": "1. **[Shy Semicolons](https://github.com/inancgumus/learngo/tree/master/04-statements-expressions-comments/exercises/01-"
},
{
"path": "04-statements-expressions-comments/questions/01-statements/README.md",
"chars": 2882,
"preview": "## Which one is the correct description for a statement?\n1. A statement instructs Go to do something *CORRECT*\n2. A stat"
},
{
"path": "04-statements-expressions-comments/questions/02-expressions/README.md",
"chars": 66,
"preview": "## Please check out the questions inside the statements directory."
},
{
"path": "04-statements-expressions-comments/questions/03-comments/README.md",
"chars": 2199,
"preview": "## Why do you need to use comments sometimes?\n1. To combine different expressions together\n2. To provide explanations or"
},
{
"path": "05-write-your-first-library-package/exercise/README.md",
"chars": 1157,
"preview": "[Check out the exercise and its solution here.](https://github.com/inancgumus/learngo/tree/master/05-write-your-first-li"
},
{
"path": "05-write-your-first-library-package/exercise/solution/golang/cmd/main.go",
"chars": 528,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "05-write-your-first-library-package/exercise/solution/golang/go.go",
"chars": 440,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "05-write-your-first-library-package/printer/cmd/main.go",
"chars": 476,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "05-write-your-first-library-package/printer/printer.go",
"chars": 419,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "05-write-your-first-library-package/questions/README.md",
"chars": 3373,
"preview": "## Which one below is correct?\n**NOTE** _There are explanations inside the answers. Even if you know the answer please t"
},
{
"path": "06-variables/01-basic-data-types/exercises/01-print-the-literals/main.go",
"chars": 750,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/01-basic-data-types/exercises/01-print-the-literals/solution/main.go",
"chars": 514,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/01-basic-data-types/exercises/02-print-hexes/main.go",
"chars": 1482,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/01-basic-data-types/exercises/02-print-hexes/solution/main.go",
"chars": 558,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/01-basic-data-types/exercises/README.md",
"chars": 372,
"preview": "1. **[Print the literals](https://github.com/inancgumus/learngo/tree/master/06-variables/01-basic-data-types/exercises/0"
},
{
"path": "06-variables/01-basic-data-types/main.go",
"chars": 733,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/01-basic-data-types/questions/README.md",
"chars": 526,
"preview": "## Which one below is an integer literal?\n* -42 *CORRECT*\n * This is an integer literal\n* \"Hello\"\n * This is a str"
},
{
"path": "06-variables/02-declarations/01-declaration-syntax/01-syntax/main.go",
"chars": 387,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/01-declaration-syntax/02-naming-rules/main.go",
"chars": 594,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/01-declaration-syntax/03-order-of-declaration/main.go",
"chars": 378,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/02-example-declarations/01-int/main.go",
"chars": 445,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/02-example-declarations/02-float64/main.go",
"chars": 453,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/02-example-declarations/03-bool/main.go",
"chars": 442,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/02-example-declarations/04-string/main.go",
"chars": 442,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/03-zero-values/main.go",
"chars": 690,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/04-unused-variables-and-blank-identifier/01-unused-variable/main.go",
"chars": 520,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/04-unused-variables-and-blank-identifier/02-blank-identifier/main.go",
"chars": 459,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/05-multiple-declarations/01-multiple/main.go",
"chars": 503,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/05-multiple-declarations/02-parallel/main.go",
"chars": 555,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/06-examples/main.go",
"chars": 814,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/01-int/main.go",
"chars": 644,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/01-int/solution/main.go",
"chars": 394,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/02-bool/main.go",
"chars": 626,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/02-bool/solution/main.go",
"chars": 390,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/03-float64/main.go",
"chars": 655,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/03-float64/solution/main.go",
"chars": 406,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/04-string/main.go",
"chars": 757,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/04-string/solution/main.go",
"chars": 399,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/05-undeclarables/main.go",
"chars": 794,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/05-undeclarables/solution/main.go",
"chars": 447,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/06-with-bits/main.go",
"chars": 959,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/06-with-bits/solution/main.go",
"chars": 823,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/07-multiple/main.go",
"chars": 845,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/07-multiple/solution/main.go",
"chars": 416,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/08-multiple-2/main.go",
"chars": 947,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/08-multiple-2/solution/main.go",
"chars": 436,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/09-unused/main.go",
"chars": 642,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/09-unused/solution/main.go",
"chars": 370,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/10-package-variable/main.go",
"chars": 613,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/10-package-variable/solution/main.go",
"chars": 356,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/11-wrong-doer/main.go",
"chars": 695,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/11-wrong-doer/solution/main.go",
"chars": 421,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/02-declarations/exercises/README.md",
"chars": 1576,
"preview": "# Declare and Print Variables\n\nWarm up. Declare a few variables and get some experience. Get used to the variable declar"
},
{
"path": "06-variables/02-declarations/questions/01-what/README.md",
"chars": 530,
"preview": "# QUESTIONS: What's a variable?\n\n## Where does a variable live?\n* Hard Disk\n* Computer Memory - *CORRECT*\n* CPU\n\n## What"
},
{
"path": "06-variables/02-declarations/questions/02-declaration/README.md",
"chars": 478,
"preview": "## Which statement do you need to use for declaring variables?\n* name int\n* vars string name\n* var name integer\n* var wi"
},
{
"path": "06-variables/02-declarations/questions/03-unused-variables/README.md",
"chars": 536,
"preview": "## What happens when you don't use a declared variable in the block scope?\n* Nothing, it will work fine\n* It will get re"
},
{
"path": "06-variables/02-declarations/questions/04-zero-values/README.md",
"chars": 366,
"preview": "## Which type's zero value is 0?\n- bool\n- pointer\n- string\n- all numeric types *CORRECT*\n\n## Which type's zero value is "
},
{
"path": "06-variables/03-short-declaration/01-initialization-and-short-declaration/01-initialization/main.go",
"chars": 646,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/01-initialization-and-short-declaration/02-short-declaration/main.go",
"chars": 818,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/01-initialization-and-short-declaration/03-coding-example/main.go",
"chars": 886,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/02-package-scope/main.go",
"chars": 735,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/03-multiple-short-declaration/01-declaration/main.go",
"chars": 543,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/03-multiple-short-declaration/02-coding-example/main.go",
"chars": 832,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/03-multiple-short-declaration/03-redeclaration/01/main.go",
"chars": 753,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/03-multiple-short-declaration/03-redeclaration/02-coding-example/main.go",
"chars": 960,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/04-short-vs-normal/01-declaration/main.go",
"chars": 1026,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/04-short-vs-normal/02-short-declaration/main.go",
"chars": 866,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/01-short-declare/main.go",
"chars": 783,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/01-short-declare/solution/main.go",
"chars": 464,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/02-multiple-short-declare/main.go",
"chars": 685,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/02-multiple-short-declare/solution/main.go",
"chars": 394,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/03-multiple-short-declare-2/main.go",
"chars": 780,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/03-multiple-short-declare-2/solution/main.go",
"chars": 396,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/04-short-with-expression/main.go",
"chars": 727,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/04-short-with-expression/solution/main.go",
"chars": 392,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/05-short-discard/main.go",
"chars": 893,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/05-short-discard/solution/main.go",
"chars": 446,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/06-redeclare/main.go",
"chars": 909,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/06-redeclare/solution/main.go",
"chars": 439,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/03-short-declaration/exercises/README.md",
"chars": 999,
"preview": "# Short Declare\n\nTime to declare a few variables using the short declaration syntax. You'll also use the redeclaration a"
},
{
"path": "06-variables/03-short-declaration/questions/README.md",
"chars": 1383,
"preview": "## Which is a correct declaration?\n* var int safe := 3\n* var safe bool := 3\n* safe := true *CORRECT*\n\n## Which is a corr"
},
{
"path": "06-variables/04-assignment/01-assignment/01-assignment/main.go",
"chars": 461,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/01-assignment/02-strongly-typed/main.go",
"chars": 828,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/01-assignment/03-examples/main.go",
"chars": 964,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/01-overview/main.go",
"chars": 646,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/05-multiple-assignment/main.go",
"chars": 571,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/06-swapping/main.go",
"chars": 466,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/07-path-project/main.go",
"chars": 483,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/08-path-project-discarding/main.go",
"chars": 449,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/09-path-project-shortdecl/main.go",
"chars": 490,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/01-make-it-blue/main.go",
"chars": 673,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/01-make-it-blue/solution/main.go",
"chars": 407,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/02-vars-to-vars/main.go",
"chars": 1105,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/02-vars-to-vars/solution/main.go",
"chars": 456,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/03-assign-with-expressions/main.go",
"chars": 857,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/03-assign-with-expressions/solution/main.go",
"chars": 392,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/main.go",
"chars": 1072,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/solution/main.go",
"chars": 571,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/05-multi-assign/main.go",
"chars": 847,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/05-multi-assign/solution/main.go",
"chars": 458,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/06-multi-assign-2/main.go",
"chars": 894,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/06-multi-assign-2/solution/main.go",
"chars": 560,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/07-multi-short-func/main.go",
"chars": 1026,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/07-multi-short-func/solution/main.go",
"chars": 432,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/08-swapper/main.go",
"chars": 744,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/08-swapper/solution/main.go",
"chars": 448,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/09-swapper-2/main.go",
"chars": 664,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/09-swapper-2/solution/main.go",
"chars": 428,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/10-discard-the-file/main.go",
"chars": 724,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/10-discard-the-file/solution/main.go",
"chars": 424,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/04-assignment/exercises/README.md",
"chars": 1528,
"preview": "# Assignments\n\nAssignment means \"copying\" values. Everything is getting copied in Go. You'll learn more about this after"
},
{
"path": "06-variables/04-assignment/questions/README.md",
"chars": 1293,
"preview": "## What happens when you assign a variable to another variable?\n* The variables become the same variable\n* Assignee vari"
},
{
"path": "06-variables/05-type-conversion/01-destructive/main.go",
"chars": 584,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/02-correct/main.go",
"chars": 740,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/03-numeric-conversion/main.go",
"chars": 1034,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/exercises/01-convert-and-fix/main.go",
"chars": 619,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/exercises/01-convert-and-fix/solution/main.go",
"chars": 397,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/exercises/02-convert-and-fix-2/main.go",
"chars": 632,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/exercises/02-convert-and-fix-2/solution/main.go",
"chars": 409,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/exercises/03-convert-and-fix-3/main.go",
"chars": 569,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/exercises/03-convert-and-fix-3/solution/main.go",
"chars": 369,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/exercises/04-convert-and-fix-4/main.go",
"chars": 593,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/exercises/04-convert-and-fix-4/solution/main.go",
"chars": 394,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/exercises/05-convert-and-fix-5/main.go",
"chars": 762,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/exercises/05-convert-and-fix-5/solution/main.go",
"chars": 746,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/05-type-conversion/exercises/README.md",
"chars": 841,
"preview": "# Type Conversion\n\nHere are 5 exercises for you. You must find the errors and then fix them using the correct type conve"
},
{
"path": "06-variables/05-type-conversion/questions/questions.md",
"chars": 1025,
"preview": "## Which one is a correct type conversion expression?\n* convert(40)\n* var(\"hi\")\n* int(4.) *CORRECT*\n* int[4]\n\n## What do"
},
{
"path": "06-variables/06-project-greeter/01-demonstration/main.go",
"chars": 856,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/02-version1/main.go",
"chars": 866,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/03-version2/main.go",
"chars": 849,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/exercises/01-count-arguments/main.go",
"chars": 765,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/exercises/01-count-arguments/solution/main.go",
"chars": 434,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/exercises/02-print-the-path/main.go",
"chars": 745,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/exercises/02-print-the-path/solution/main.go",
"chars": 553,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/exercises/03-print-your-name/main.go",
"chars": 854,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/exercises/03-print-your-name/solution/main.go",
"chars": 471,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/exercises/04-greet-more-people/main.go",
"chars": 982,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/exercises/04-greet-more-people/solution/main.go",
"chars": 641,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/exercises/05-greet-5-people/main.go",
"chars": 905,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/exercises/05-greet-5-people/solution/main.go",
"chars": 679,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/exercises/README.md",
"chars": 719,
"preview": "# Command Line Arguments\n\n1. **[Count the Arguments](https://github.com/inancgumus/learngo/tree/master/06-variables/06-p"
},
{
"path": "06-variables/06-project-greeter/exercises/solution-to-the-lecture-exercise/main.go",
"chars": 1122,
"preview": "// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa"
},
{
"path": "06-variables/06-project-greeter/questions/questions.md",
"chars": 996,
"preview": "## What's does `os.Args` variable store in its first item?\n* The first argument that is passed to the program\n* The seco"
}
]
// ... and 1333 more files (download for full content)
About this extraction
This page contains the full source code of the inancgumus/learngo GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1533 files (1.6 MB), approximately 538.5k tokens, and a symbol index with 2055 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.