Showing preview only (3,978K chars total). Download the full file or copy to clipboard to get everything.
Repository: GoesToEleven/GolangTraining
Branch: master
Commit: f9a4f6cf3939
Files: 1906
Total size: 3.4 MB
Directory structure:
gitextract_hr2xhgpb/
├── .gitignore
├── 01_getting-started/
│ ├── 01_helloWorld/
│ │ └── main.go
│ ├── 02_numeral-systems/
│ │ ├── 01_decimal/
│ │ │ └── main.go
│ │ ├── 02_binary/
│ │ │ └── main.go
│ │ ├── 03_hexadecimal/
│ │ │ └── main.go
│ │ └── 04_loop/
│ │ └── main.go
│ └── 03_UTF-8/
│ └── main.go
├── 02_package/
│ ├── icomefromalaska/
│ │ └── name2.go
│ ├── main/
│ │ └── main.go
│ └── stringutil/
│ ├── name.go
│ ├── reverse.go
│ └── reverseTwo.go
├── 03_variables/
│ ├── 01_shorthand/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 02_var_zero-value/
│ │ └── main.go
│ └── 03_less-emphasis/
│ ├── 01_declare-variable/
│ │ └── var.go
│ ├── 02_declare-many-at-once/
│ │ └── var.go
│ ├── 03_init-many-at-once/
│ │ └── var.go
│ ├── 04_infer-type/
│ │ └── var.go
│ ├── 05_infer-mixed-up-types/
│ │ └── var.go
│ ├── 06_init-shorthand/
│ │ └── var.go
│ ├── 07_all-together/
│ │ └── variables.go
│ └── 08_exercise_your-name/
│ ├── 01_oneSolution/
│ │ └── myNameVar.go
│ ├── 02_anotherSolution/
│ │ └── myNameVar.go
│ ├── 03_anotherSolution/
│ │ └── myNameVar.go
│ └── 04_anotherSolution/
│ └── myNameVar.go
├── 04_scope/
│ ├── 01_package-scope/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02_visibility/
│ │ ├── main/
│ │ │ └── main.go
│ │ └── vis/
│ │ ├── name.go
│ │ └── printer.go
│ ├── 02_block-scope/
│ │ ├── 01_this-does-not-compile/
│ │ │ └── main.go
│ │ └── 02_closure/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ ├── 03/
│ │ │ └── main.go
│ │ └── 04/
│ │ └── main.go
│ ├── 03_order-matters/
│ │ └── main.go
│ ├── 04_variable-shadowing/
│ │ └── main.go
│ └── 05_same-package/
│ ├── main.go
│ └── same.go
├── 05_blank-identifier/
│ ├── 01_invalid-code/
│ │ └── main.go
│ └── 02_http-get_example/
│ ├── 01_with-error-checking/
│ │ └── main.go
│ └── 02_no-error-checking/
│ └── main.go
├── 06_constants/
│ ├── 01_constant/
│ │ └── main.go
│ ├── 02_multiple-initialization/
│ │ └── main.go
│ ├── 03_iota/
│ │ └── main.go
│ ├── 04_iota/
│ │ └── main.go
│ ├── 05_iota/
│ │ └── main.go
│ ├── 06_iota/
│ │ └── main.go
│ └── 07_iota/
│ └── main.go
├── 07_memory-address/
│ ├── 01_showing-address/
│ │ └── main.go
│ └── 02_using-address/
│ └── main.go
├── 08_pointers/
│ ├── 01_referencing/
│ │ └── main.go
│ ├── 02_dereferencing/
│ │ └── main.go
│ ├── 03_using-pointers/
│ │ └── main.go
│ └── 04_using-pointers/
│ ├── 01_no-pointer/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02_see-the-addresses/
│ │ └── main.go
│ └── 02_pointer/
│ ├── 01/
│ │ └── main.go
│ └── 02_see-the-addresses/
│ └── main.go
├── 09_remainder/
│ └── main.go
├── 10_for-loop/
│ ├── 01_init-condition-post/
│ │ └── main.go
│ ├── 02_nested/
│ │ └── main.go
│ ├── 03_for-condition-while-ish/
│ │ └── main.go
│ ├── 04_for_no-condition/
│ │ └── main.go
│ ├── 05_for_break/
│ │ └── main.go
│ ├── 06_for_continue/
│ │ └── main.go
│ └── 07_rune-loop_UTF8/
│ ├── 01/
│ │ └── main.go
│ └── 02/
│ └── main.go
├── 11_switch-statements/
│ ├── 01_switch/
│ │ └── main.go
│ ├── 02_fallthrough/
│ │ └── main.go
│ ├── 03_multiple-evals/
│ │ └── main.go
│ ├── 04_no-expression/
│ │ └── main.go
│ └── 05_on-type/
│ └── type.go
├── 12_if_else-if_else/
│ ├── 01_eval-true/
│ │ └── main.go
│ ├── 02_not-exclamation/
│ │ └── main.go
│ ├── 03_init-statement/
│ │ └── main.go
│ ├── 04_init-statement_error_invalid-code/
│ │ └── main.go
│ ├── 05_if-else/
│ │ └── main.go
│ ├── 06_if-elseif-else/
│ │ └── main.go
│ ├── 07_if-elseif-elseif-else/
│ │ └── main.go
│ └── 08_divisibleByThree/
│ └── main.go
├── 13_exercise-solutions/
│ ├── 01_hello-world/
│ │ └── main.go
│ ├── 02_hello-NAME/
│ │ └── main.go
│ ├── 03_hello-user-input/
│ │ └── main.go
│ ├── 04_user-enters-numbers/
│ │ └── main.go
│ ├── 05_even-numbers/
│ │ └── main.go
│ ├── 06_fizzBuzz/
│ │ └── main.go
│ ├── 07_threeFive/
│ │ └── main.go
│ └── 08_just-fyi/
│ ├── 01_benchMark/
│ │ └── bm_test.go
│ ├── 02_benchMark/
│ │ └── bm_test.go
│ └── 03_utf/
│ └── main.go
├── 14_functions/
│ ├── 01_main/
│ │ └── main.go
│ ├── 02_param-arg/
│ │ └── main.go
│ ├── 03_two-params/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 04_return/
│ │ └── main.go
│ ├── 05_return-naming/
│ │ └── main.go
│ ├── 06_return-multiple/
│ │ └── main.go
│ ├── 07_variadic-params/
│ │ └── main.go
│ ├── 08_variadic-args/
│ │ └── main.go
│ ├── 09_slice-param-arg/
│ │ └── main.go
│ ├── 10_func-expression/
│ │ ├── 01_before-func-expression/
│ │ │ └── main.go
│ │ ├── 02_func-expression/
│ │ │ └── main.go
│ │ ├── 03_func-expression_shows-type/
│ │ │ └── main.go
│ │ ├── 04_another-way_func-expression/
│ │ │ └── main.go
│ │ └── 05_another-way_func-expression_shows-type/
│ │ └── main.go
│ ├── 11_closure/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ ├── 03/
│ │ │ └── main.go
│ │ ├── 04/
│ │ │ └── main.go
│ │ └── 05/
│ │ └── main.go
│ ├── 12_callbacks/
│ │ ├── 01_print-nums/
│ │ │ └── main.go
│ │ └── 02_filter-nums/
│ │ └── main.go
│ ├── 13_recursion/
│ │ └── main.go
│ ├── 14_defer/
│ │ ├── 01_no-defer/
│ │ │ └── main.go
│ │ └── 02_with-defer/
│ │ └── main.go
│ ├── 15_passing-by-value/
│ │ ├── 01_int/
│ │ │ └── main.go
│ │ ├── 02_int-pointer/
│ │ │ └── main.go
│ │ ├── 03_string/
│ │ │ └── main.go
│ │ ├── 04_string-pointer/
│ │ │ └── main.go
│ │ ├── 05_REFERENCE-TYPE/
│ │ │ └── main.go
│ │ ├── 06_REFERENCE-TYPE/
│ │ │ └── main.go
│ │ └── 07_struct-pointer/
│ │ └── main.go
│ └── 16_anon_self-executing/
│ └── main.go
├── 15_bool-expressions/
│ ├── 01_true-false/
│ │ └── main.go
│ ├── 02_not/
│ │ └── main.go
│ ├── 03_or/
│ │ └── main.go
│ └── 04_and/
│ └── main.go
├── 16_exercise-solutions/
│ ├── 01_half/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 02_func-expression/
│ │ └── main.go
│ ├── 03_variadic-greatest/
│ │ └── main.go
│ ├── 04_bool-expression/
│ │ └── main.go
│ └── 05_params-and-args/
│ └── main.go
├── 17_array/
│ ├── 01/
│ │ └── main.go
│ ├── 02/
│ │ └── main.go
│ ├── 03/
│ │ └── main.go
│ ├── 04/
│ │ └── main.go
│ └── 05/
│ └── main.go
├── 18_slice/
│ ├── 01_int-slice/
│ │ └── main.go
│ ├── 02_int-slice/
│ │ └── main.go
│ ├── 03_int-slice/
│ │ └── main.go
│ ├── 04_string-slice/
│ │ └── main.go
│ ├── 05_slicing-a-slice/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 06_make/
│ │ └── main.go
│ ├── 07_append-invalid/
│ │ └── main.go
│ ├── 08_append/
│ │ └── main.go
│ ├── 09_append-beyond-capacity/
│ │ └── main.go
│ ├── 10_append_slice-to-slice/
│ │ ├── 01_slice-of-ints/
│ │ │ └── main.go
│ │ └── 02_slice-of-strings/
│ │ └── main.go
│ ├── 11_delete/
│ │ └── main.go
│ ├── 12_multi-dimensional/
│ │ ├── 01_shorthand-slice/
│ │ │ └── main.go
│ │ ├── 02_var-slice/
│ │ │ └── main.go
│ │ ├── 03_make-slice/
│ │ │ └── main.go
│ │ ├── 04_comparing_shorthand_var_make/
│ │ │ ├── 01_shorthand-slice/
│ │ │ │ └── main.go
│ │ │ ├── 02_var-slice/
│ │ │ │ └── main.go
│ │ │ └── 03_make-slice/
│ │ │ └── main.go
│ │ ├── 05_slice-of-slice-of-string/
│ │ │ └── main.go
│ │ └── 06_slice-of-slice-of-int/
│ │ └── main.go
│ └── 13_int-slice-plus-plus/
│ └── main.go
├── 19_map/
│ ├── 01_var_nil-map/
│ │ └── main.go
│ ├── 02_var_make/
│ │ └── main.go
│ ├── 03_shorthand_make/
│ │ └── main.go
│ ├── 04_shorthand_composite-literal/
│ │ └── main.go
│ ├── 05_shorthand_composite-literal/
│ │ └── main.go
│ ├── 06_adding-entry/
│ │ └── main.go
│ ├── 07_len/
│ │ └── main.go
│ ├── 08_updating-entry/
│ │ └── main.go
│ ├── 09_deleting-entry/
│ │ └── main.go
│ ├── 10_comma-ok-idiom_val-exists/
│ │ └── main.go
│ ├── 11_deleting-entry_no-error/
│ │ └── main.go
│ ├── 12_comma-ok-idiom_val-not-exists/
│ │ └── main.go
│ ├── 13_loop-range/
│ │ └── main.go
│ └── 14_hash-table/
│ ├── 01_letter-buckets/
│ │ ├── 01_runes-are-numbers/
│ │ │ └── main.go
│ │ ├── 02_strings-to-rune-conversion/
│ │ │ └── main.go
│ │ ├── 03_string-index-access/
│ │ │ └── main.go
│ │ ├── 04_remainder-bucket-selection/
│ │ │ └── main.go
│ │ ├── 05_hash-function/
│ │ │ └── main.go
│ │ ├── 06_get/
│ │ │ └── main.go
│ │ ├── 07_scanner/
│ │ │ └── main.go
│ │ ├── 08_moby-dicks-words/
│ │ │ └── main.go
│ │ ├── 09_int-slice-plus-plus/
│ │ │ └── main.go
│ │ ├── 10_hash-letter-buckets/
│ │ │ └── main.go
│ │ └── 11_hash-remainder-buckets/
│ │ └── main.go
│ ├── 02_even-dstribution-hash/
│ │ └── main.go
│ ├── 03_words-in-buckets/
│ │ ├── 01_slice-bucket/
│ │ │ └── main.go
│ │ └── 02_map-bucket/
│ │ └── main.go
│ └── 04_english-alphabet/
│ ├── 01/
│ │ └── main.go
│ └── 02/
│ └── main.go
├── 20_struct/
│ ├── 00_object-oriented/
│ │ └── notes.txt
│ ├── 01_user-defined-types/
│ │ ├── 01_alias-type_not-idiomatic/
│ │ │ └── main.go
│ │ ├── 02_static-typing/
│ │ │ └── main.go
│ │ └── notes.txt
│ ├── 02_struct_fields_values_initialization/
│ │ ├── main.go
│ │ └── notes.txt
│ ├── 03_methods/
│ │ ├── main.go
│ │ └── notes.txt
│ ├── 04_embedded-types/
│ │ └── main.go
│ ├── 05_promotion/
│ │ ├── 01_overriding-fields/
│ │ │ └── main.go
│ │ └── 02_overriding-methods/
│ │ └── main.go
│ ├── 06_struct-pointer/
│ │ └── main.go
│ ├── 07_marshal_unmarshal/
│ │ ├── 01_marshal/
│ │ │ ├── 01_exported/
│ │ │ │ └── main.go
│ │ │ ├── 02_unexported/
│ │ │ │ └── main.go
│ │ │ └── 03_tags/
│ │ │ └── main.go
│ │ └── 02_unmarshal/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02_tags/
│ │ └── main.go
│ └── 08_encode_decode/
│ ├── 01_encode/
│ │ └── main.go
│ └── 02_decode/
│ └── main.go
├── 21_interfaces/
│ ├── 00_notes.txt
│ ├── 01_interface/
│ │ ├── 01_no-interface/
│ │ │ └── main.go
│ │ ├── 02_interface/
│ │ │ └── main.go
│ │ ├── 03_interface/
│ │ │ └── main.go
│ │ ├── 04_interface/
│ │ │ └── main.go
│ │ └── 05_io-copy/
│ │ ├── 01_no-error-checking/
│ │ │ └── main.go
│ │ └── 02_error-checking/
│ │ └── main.go
│ ├── 02_package-sort/
│ │ ├── 00_notes.txt
│ │ ├── 01_sort-names/
│ │ │ └── main.go
│ │ ├── 02_sort-names_type-StringSlice/
│ │ │ └── main.go
│ │ ├── 03_sort-Strings/
│ │ │ └── main.go
│ │ ├── 04_sort-names_type-StringSlice_reverse/
│ │ │ └── main.go
│ │ ├── 05_sort-int_type-IntSlice/
│ │ │ └── main.go
│ │ ├── 06_sort-int_type-IntSlice_reverse/
│ │ │ └── main.go
│ │ ├── 07_sort-Ints/
│ │ │ └── main.go
│ │ └── 08_standard-library-example/
│ │ └── main.go
│ ├── 03_empty-interface/
│ │ ├── 01_no-interface/
│ │ │ └── main.go
│ │ ├── 02_empty-interface/
│ │ │ └── main.go
│ │ ├── 03_param-accepts-any-type/
│ │ │ └── main.go
│ │ └── 04_slice-of-any-type/
│ │ └── main.go
│ ├── 04_method-sets/
│ │ ├── 01_value-receiver_value-type/
│ │ │ └── main.go
│ │ ├── 02_value-receiver_pointer-type/
│ │ │ └── main.go
│ │ ├── 03_pointer-receiver_pointer-type/
│ │ │ └── main.go
│ │ └── 04_pointer-receiver_value-type/
│ │ └── main.go
│ └── 05_conversion-vs-assertion/
│ ├── 01_conversion/
│ │ ├── 01_int-to-float/
│ │ │ └── main.go
│ │ ├── 02_float-to-int/
│ │ │ └── main.go
│ │ ├── 03_rune-to-string/
│ │ │ └── main.go
│ │ ├── 04_rune-to-slice-of-bytes-to-string/
│ │ │ └── main.go
│ │ ├── 05_string-to-slice-of-bytes/
│ │ │ └── main.go
│ │ └── 06_strconv/
│ │ ├── 01_Atoi/
│ │ │ └── main.go
│ │ ├── 02_Itoa/
│ │ │ └── main.go
│ │ └── 03_ParseInt/
│ │ └── main.go
│ └── 02_assertion/
│ ├── 01_non-interface-error_invalid-code/
│ │ └── main.go
│ ├── 02_interface-string/
│ │ └── main.go
│ ├── 03_interface-string_not-ok/
│ │ └── main.go
│ ├── 04_interface-int_print-type/
│ │ └── main.go
│ ├── 05_interface-int_mistmatched-types-error/
│ │ └── main.go
│ ├── 06_interface-int-sum/
│ │ └── main.go
│ ├── 07_casting-reminder/
│ │ └── main.go
│ └── 08_interface-cast-error_need-type-assertion/
│ └── main.go
├── 22_go-routines/
│ ├── 01_no-go/
│ │ └── main.go
│ ├── 02_go_concurrency/
│ │ └── main.go
│ ├── 03_wait-group/
│ │ └── main.go
│ ├── 04_time-sleep/
│ │ └── main.go
│ ├── 05_gomaxprocs_parallelism/
│ │ └── main.go
│ ├── 06_race-condition/
│ │ └── main.go
│ ├── 07_mutex/
│ │ └── main.go
│ ├── 08_atomicity/
│ │ └── main.go
│ ├── 09_channels/
│ │ ├── 00_unbuffered-channels-block/
│ │ │ └── main.go
│ │ ├── 01_range/
│ │ │ └── main.go
│ │ ├── 02_n-to-1/
│ │ │ ├── 01_race-condition/
│ │ │ │ └── main.go
│ │ │ ├── 02_wait-group/
│ │ │ │ └── main.go
│ │ │ ├── 03_semaphore/
│ │ │ │ └── main.go
│ │ │ ├── 04_semaphore_wrong-way/
│ │ │ │ └── main.go
│ │ │ └── 05_n-times_to_1/
│ │ │ └── main.go
│ │ ├── 03_1-to-n/
│ │ │ ├── 01_1_to_2-times/
│ │ │ │ └── main.go
│ │ │ └── 02_1_to_n-times/
│ │ │ └── main.go
│ │ ├── 04_pass-return-channels/
│ │ │ └── main.go
│ │ ├── 05_channel-direction/
│ │ │ └── main.go
│ │ ├── 06_refactor/
│ │ │ └── main.go
│ │ ├── 07_incrementor/
│ │ │ └── main.go
│ │ └── 08_closures/
│ │ ├── 01_no-closure-binding/
│ │ │ └── main.go
│ │ ├── 02_closure-binding/
│ │ │ └── main.go
│ │ └── 03_closure-binding/
│ │ └── main.go
│ ├── 10_deadlock-challenges/
│ │ ├── 01_deadlock-challenge/
│ │ │ └── main.go
│ │ ├── 02_deadlock-solution/
│ │ │ └── main.go
│ │ ├── 03_deadlock-challenge/
│ │ │ └── main.go
│ │ ├── 04_deadlock-challenge/
│ │ │ └── main.go
│ │ └── 05_deadlock-solution/
│ │ └── main.go
│ ├── 11_factorial-challenge/
│ │ ├── 01_challenge-description/
│ │ │ └── main.go
│ │ └── 02_challenge-solution/
│ │ └── main.go
│ ├── 12_channels_pipeline/
│ │ ├── 01_sq-output/
│ │ │ └── main.go
│ │ ├── 02_sq-output/
│ │ │ └── main.go
│ │ ├── 03_challenge-description/
│ │ │ └── main.go
│ │ └── 04_challenge-solution/
│ │ ├── 01_original-solution/
│ │ │ └── main.go
│ │ ├── 02_another-solution/
│ │ │ └── main.go
│ │ └── README.md
│ ├── 13_channels_fan-out_fan-in/
│ │ ├── 01_boring/
│ │ │ └── main.go
│ │ ├── 02_sq-output/
│ │ │ └── main.go
│ │ ├── 03_sq-output_variation/
│ │ │ └── main.go
│ │ ├── 04_challenge-description/
│ │ │ └── main.go
│ │ ├── 05_challenge-solution/
│ │ │ └── main.go
│ │ ├── 06_challenge-description/
│ │ │ └── main.go
│ │ ├── 07_challenge-solution/
│ │ │ └── main.go
│ │ ├── 08_challenge-description/
│ │ │ └── main.go
│ │ ├── 09_challenge-solution/
│ │ │ ├── 01_troubleshooting-step/
│ │ │ │ └── main.go
│ │ │ └── 02_solution/
│ │ │ └── main.go
│ │ └── 10_van-sickle_fan-out_fan-in/
│ │ └── main.go
│ ├── 14_incrementor-challenge/
│ │ ├── 01_description/
│ │ │ └── main.go
│ │ └── 02_solution/
│ │ └── main.go
│ └── 15_for-fun/
│ ├── 01/
│ │ └── main.go
│ └── README.md
├── 23_error-handling/
│ ├── 01_golint/
│ │ ├── 01_before/
│ │ │ └── main.go
│ │ └── 02_after/
│ │ └── main.go
│ ├── 02_err-not-nil/
│ │ ├── 01_fmt-println/
│ │ │ └── main.go
│ │ ├── 02_log-println/
│ │ │ └── main.go
│ │ ├── 03_log-set-output/
│ │ │ ├── log.txt
│ │ │ └── main.go
│ │ ├── 04_log-fatalln/
│ │ │ └── main.go
│ │ └── 05_panic/
│ │ └── main.go
│ └── 03_custom-errors/
│ ├── 01_errors-new/
│ │ └── main.go
│ ├── 02_errors-new_var/
│ │ └── main.go
│ ├── 03_fmt-errorf/
│ │ └── main.go
│ ├── 04_fmt-errorf_var/
│ │ └── main.go
│ └── 05_custom-type/
│ └── main.go
├── 24_testing/
│ ├── math.go
│ └── math_test.go
├── 25_code-walk/
│ ├── main.go
│ └── with-comments/
│ └── main.go
├── 26_QUESTIONS-FROM-STUDENTS/
│ ├── 01-package-scope/
│ │ ├── main.go
│ │ └── variables.go
│ ├── 02-goroutines-printing/
│ │ └── main.go
│ ├── 03-range-chan/
│ │ └── main.go
│ ├── 04_goroutines_closing-chan/
│ │ ├── 01_broken-code/
│ │ │ └── main.go
│ │ └── 02_fixed-code/
│ │ └── main.go
│ ├── 05_concurrency-channels/
│ │ └── main.go
│ └── 06_performance-ramifications/
│ ├── 01_called/
│ │ └── main.go
│ └── 02_not-called/
│ └── main.go
├── 27_code-in-process/
│ ├── 26_playing-with-type/
│ │ ├── 00_types/
│ │ │ ├── 01_division/
│ │ │ │ ├── 01_int-int/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02_int-float/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03_var_int-float/
│ │ │ │ │ └── main.go
│ │ │ │ └── 04_var_int-float_invalid-code/
│ │ │ │ └── main.go
│ │ │ ├── 02_strings/
│ │ │ │ ├── 01_escape-sequences/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02_sequence-of-bytes/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 03_immutable/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 04_len/
│ │ │ │ │ ├── 01_len-english/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02_len-chinese/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 03_binary/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 05_index-access/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 06_slicing/
│ │ │ │ │ ├── 01/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── 02/
│ │ │ │ │ │ └── main.go
│ │ │ │ │ └── 03_invalid_negative-index/
│ │ │ │ │ └── main.go
│ │ │ │ └── 07_concatenation/
│ │ │ │ └── main.go
│ │ │ ├── 03_strconv/
│ │ │ │ ├── 01_itoa/
│ │ │ │ │ └── main.go
│ │ │ │ ├── 02_fmt-sprint/
│ │ │ │ │ └── main.go
│ │ │ │ └── 03_atoi/
│ │ │ │ └── main.go
│ │ │ ├── 06_math-pkg/
│ │ │ │ └── main.go
│ │ │ └── 07_typeOf/
│ │ │ ├── 01_better-code/
│ │ │ │ └── main.go
│ │ │ └── 02_worse-code/
│ │ │ └── main.go
│ │ ├── 01_struct/
│ │ │ └── main.go
│ │ ├── 02_string/
│ │ │ └── main.go
│ │ ├── 03_string-conversion/
│ │ │ └── main.go
│ │ ├── 04_string_assertion_invalid-code/
│ │ │ └── main.go
│ │ ├── 05_var-for-zero-val-initalization/
│ │ │ └── main.go
│ │ ├── 06_shorthand-notation_nonzero-initalization/
│ │ │ └── main.go
│ │ ├── xx05_slice-strings/
│ │ │ └── main.go
│ │ ├── xx06_slice-strings_conversion/
│ │ │ └── main.go
│ │ ├── xx07_int/
│ │ │ └── main.go
│ │ └── xx08_slice-ints/
│ │ └── main.go
│ ├── 27_package-os/
│ │ ├── 00_args/
│ │ │ └── main.go
│ │ ├── 01_Read/
│ │ │ └── 01/
│ │ │ ├── dst.txt
│ │ │ ├── main.go
│ │ │ └── src.txt
│ │ ├── 02_Write/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ ├── hello.txt
│ │ │ │ └── main.go
│ │ │ └── 03_absolute-path/
│ │ │ └── main.go
│ │ ├── 03_mkdir/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 04_FileMode/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 05_file-open/
│ │ │ └── main.go
│ │ ├── 06_file-create/
│ │ │ └── main.go
│ │ └── 07_Stdout_Stdin/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 28_package-strings/
│ │ ├── 01_strings/
│ │ │ └── main.go
│ │ └── 02_NewReader/
│ │ └── main.go
│ ├── 29_package-bufio/
│ │ ├── 01_NewReader/
│ │ │ └── main.go
│ │ ├── 02_NewScanner/
│ │ │ └── main.go
│ │ ├── 03_scan-lines/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ └── 04_scan-words/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ └── 03/
│ │ └── main.go
│ ├── 30_package-io/
│ │ ├── 01_copy/
│ │ │ └── main.go
│ │ ├── 02_copy/
│ │ │ └── main.go
│ │ ├── 03_copy/
│ │ │ └── main.go
│ │ ├── 04_TeeReader/
│ │ │ ├── 01/
│ │ │ │ ├── main.go
│ │ │ │ └── src.txt
│ │ │ └── 02/
│ │ │ ├── main.go
│ │ │ └── src.txt
│ │ ├── 05_ReadFull/
│ │ │ ├── dst.txt
│ │ │ ├── main.go
│ │ │ └── src.txt
│ │ ├── 06_LimitReader/
│ │ │ ├── main.go
│ │ │ └── src.txt
│ │ └── 07_WriteString/
│ │ ├── 01_one-way/
│ │ │ ├── hello.txt
│ │ │ └── main.go
│ │ └── 02_another-way/
│ │ ├── hello.txt
│ │ └── main.go
│ ├── 31_package-ioutil/
│ │ ├── 00_ReadAll/
│ │ │ └── main.go
│ │ ├── 01_ReadAll/
│ │ │ └── main.go
│ │ ├── 02_WriteFile/
│ │ │ └── main.go
│ │ └── 03_ReadAll_WriteFile/
│ │ ├── hey.txt
│ │ └── main.go
│ ├── 32_package-encoding-csv/
│ │ ├── 01_NewReader/
│ │ │ └── main.go
│ │ ├── 02_column-headings/
│ │ │ └── main.go
│ │ ├── 03_panics/
│ │ │ └── main.go
│ │ ├── 04_parse-state/
│ │ │ └── main.go
│ │ ├── 05_state-lookup/
│ │ │ └── main.go
│ │ ├── 06_write-to-html/
│ │ │ └── main.go
│ │ ├── 07_NewReader/
│ │ │ ├── main.go
│ │ │ └── table.csv
│ │ └── state_table.csv
│ ├── 33_package-path-filepath/
│ │ ├── 01_Walk/
│ │ │ └── main.go
│ │ ├── 02_Walk/
│ │ │ └── main.go
│ │ ├── 03_Walk/
│ │ │ └── main.go
│ │ └── 04_Walk/
│ │ └── main.go
│ ├── 34_package-time/
│ │ ├── 01_now/
│ │ │ └── main.go
│ │ ├── 02_time-parse/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 03_format/
│ │ │ └── main.go
│ │ └── 04_date-diff/
│ │ └── main.go
│ ├── 35_hash/
│ │ ├── 00_notes/
│ │ │ └── notes.txt
│ │ ├── 01_FNV/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ └── 02_MD5/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ └── main.go
│ ├── 36_package-filepath/
│ │ └── 01_walk/
│ │ └── main.go
│ ├── 37_review-exercises/
│ │ ├── 01_gravatar/
│ │ │ ├── main.go
│ │ │ └── page.html
│ │ ├── 02_word-count/
│ │ │ └── main.go
│ │ ├── 03_centered_average/
│ │ │ └── main.go
│ │ ├── 04_swap-two_pointers/
│ │ │ └── main.go
│ │ ├── 05_clumps/
│ │ │ └── main.go
│ │ ├── 06_cat/
│ │ │ └── main.go
│ │ ├── 07_copy/
│ │ │ ├── main.go
│ │ │ └── newFile.txt
│ │ ├── 08_cp/
│ │ │ ├── 01/
│ │ │ │ ├── initial.txt
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ ├── initial.txt
│ │ │ │ └── main.go
│ │ │ ├── 03/
│ │ │ │ ├── initial.txt
│ │ │ │ └── main.go
│ │ │ ├── 04_io-copy/
│ │ │ │ ├── initial.txt
│ │ │ │ └── main.go
│ │ │ ├── 05_os-write_slice-bytes/
│ │ │ │ └── main.go
│ │ │ ├── 06_io-copy_string-NewReader/
│ │ │ │ └── main.go
│ │ │ ├── 07_io-copy_bufio-NewReader/
│ │ │ │ ├── initial.txt
│ │ │ │ └── main.go
│ │ │ └── 08_bufio_scanner/
│ │ │ ├── initial.txt
│ │ │ └── main.go
│ │ ├── 09_sentence-case/
│ │ │ ├── initial.txt
│ │ │ └── main.go
│ │ ├── 10_every-word/
│ │ │ ├── initial.txt
│ │ │ └── main.go
│ │ ├── 11_every-other-word/
│ │ │ ├── initial.txt
│ │ │ └── main.go
│ │ ├── 12_count-words/
│ │ │ └── main.go
│ │ ├── 13_longest-word/
│ │ │ └── main.go
│ │ ├── 14_cat-files/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 15_csv_state-info/
│ │ │ ├── state_table.csv
│ │ │ ├── step01_read-and-output/
│ │ │ │ └── main.go
│ │ │ ├── step02_column-headings/
│ │ │ │ └── main.go
│ │ │ ├── step03_panics/
│ │ │ │ └── main.go
│ │ │ ├── step04_parse-state/
│ │ │ │ └── main.go
│ │ │ ├── step05_state-lookup/
│ │ │ │ └── main.go
│ │ │ └── step06_write-to-html/
│ │ │ └── main.go
│ │ ├── 16_csv_stock-prices/
│ │ │ ├── step01_stdout/
│ │ │ │ └── main.go
│ │ │ ├── step02_html/
│ │ │ │ └── main.go
│ │ │ ├── step03_charting/
│ │ │ │ ├── charting_graphing.txt
│ │ │ │ └── main.go
│ │ │ └── table.csv
│ │ ├── 17_MD5-checksum/
│ │ │ └── main.go
│ │ └── 18_Walk-dir/
│ │ └── main.go
│ ├── 38_JSON/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ ├── 03/
│ │ │ └── main.go
│ │ ├── 04/
│ │ │ └── main.go
│ │ ├── 05/
│ │ │ └── main.go
│ │ ├── 06/
│ │ │ └── main.go
│ │ ├── 07/
│ │ │ └── main.go
│ │ ├── 08/
│ │ │ └── main.go
│ │ ├── 09/
│ │ │ └── main.go
│ │ ├── 10/
│ │ │ └── main.go
│ │ ├── 11/
│ │ │ └── main.go
│ │ ├── 12/
│ │ │ ├── data.json
│ │ │ └── main.go
│ │ ├── 13/
│ │ │ ├── data.json
│ │ │ └── main.go
│ │ ├── 14/
│ │ │ └── main.go
│ │ ├── 15/
│ │ │ ├── main.go
│ │ │ └── output.txt
│ │ ├── 15_exercise_csv-to-JSON/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ ├── main.go
│ │ │ │ └── output.txt
│ │ │ └── table.csv
│ │ ├── 16/
│ │ │ └── main.go
│ │ └── 17/
│ │ ├── main.go
│ │ └── table.json
│ ├── 39_packages/
│ │ ├── hello/
│ │ │ ├── bye.go
│ │ │ └── hello.go
│ │ └── main/
│ │ └── main.go
│ ├── 40_testing/
│ │ ├── 01/
│ │ │ ├── example/
│ │ │ │ ├── sum.go
│ │ │ │ └── sum_test.go
│ │ │ └── main.go
│ │ └── 02/
│ │ ├── example/
│ │ │ ├── sum.go
│ │ │ └── sum_test.go
│ │ └── main.go
│ ├── 41_TCP/
│ │ ├── 01/
│ │ │ └── 00_notes.txt
│ │ ├── 02_listen/
│ │ │ ├── 00_notes.txt
│ │ │ └── main.go
│ │ ├── 03_dial/
│ │ │ ├── 00_notes.txt
│ │ │ └── main.go
│ │ ├── 04_echo-server/
│ │ │ ├── v01/
│ │ │ │ ├── 00_notes.txt
│ │ │ │ └── main.go
│ │ │ ├── v02/
│ │ │ │ ├── 00_notes.txt
│ │ │ │ └── main.go
│ │ │ ├── v03/
│ │ │ │ └── main.go
│ │ │ └── v04/
│ │ │ └── main.go
│ │ ├── 05_redis-clone/
│ │ │ ├── i01/
│ │ │ │ ├── i01_notes.txt
│ │ │ │ └── main.go
│ │ │ ├── i02/
│ │ │ │ ├── i02_notes.txt
│ │ │ │ └── main.go
│ │ │ ├── i03/
│ │ │ │ ├── i03_notes.txt
│ │ │ │ └── main.go
│ │ │ ├── i04/
│ │ │ │ ├── i04_notes.txt
│ │ │ │ └── main.go
│ │ │ ├── i05_code-issue/
│ │ │ │ ├── i04_notes.txt
│ │ │ │ └── main.go
│ │ │ └── i06/
│ │ │ ├── i04_notes.txt
│ │ │ └── main.go
│ │ ├── 06_rot13-server/
│ │ │ ├── v01-todd/
│ │ │ │ └── main.go
│ │ │ ├── v02-caleb/
│ │ │ │ └── main.go
│ │ │ └── v03-daniel/
│ │ │ └── main.go
│ │ └── 07_chat-server/
│ │ └── main.go
│ ├── 42_HTTP/
│ │ ├── 01_header/
│ │ │ ├── 00_notes.txt
│ │ │ └── main.go
│ │ ├── 02_http-server/
│ │ │ ├── i01/
│ │ │ │ └── main.go
│ │ │ ├── i02/
│ │ │ │ └── main.go
│ │ │ ├── i03/
│ │ │ │ └── main.go
│ │ │ ├── i04_POST/
│ │ │ │ └── main.go
│ │ │ ├── i05_not-writing_error-in-code/
│ │ │ │ └── main.go
│ │ │ ├── i06_PLAIN-TEXT/
│ │ │ │ └── main.go
│ │ │ └── i07_Location/
│ │ │ └── main.go
│ │ └── 03_http-server_return-URL/
│ │ └── main.go
│ ├── 43_HTTP-server/
│ │ ├── 01/
│ │ │ ├── i01/
│ │ │ │ └── main.go
│ │ │ └── i02/
│ │ │ └── main.go
│ │ ├── 02_requestURI/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ └── 03_restful/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ └── 03/
│ │ └── main.go
│ ├── 44_MUX_routing/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ ├── 03/
│ │ │ └── main.go
│ │ ├── 04/
│ │ │ └── main.go
│ │ ├── 05/
│ │ │ └── main.go
│ │ ├── 06_HandleFunc/
│ │ │ └── main.go
│ │ ├── 07_HandleFunc/
│ │ │ └── main.go
│ │ └── 08_HandleFunc/
│ │ └── main.go
│ ├── 45_serving-files/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ ├── 03/
│ │ │ └── main.go
│ │ ├── 04_io-Copy/
│ │ │ └── main.go
│ │ ├── 05_ServeContent/
│ │ │ └── main.go
│ │ ├── 06_ServeFile/
│ │ │ └── main.go
│ │ ├── 07_FileServer/
│ │ │ └── main.go
│ │ ├── 08_FileServer/
│ │ │ └── main.go
│ │ ├── 09_FileServer/
│ │ │ └── main.go
│ │ ├── 10_static-file-server/
│ │ │ └── main.go
│ │ └── 11_static-file-server/
│ │ └── main.go
│ ├── 46_errata/
│ │ ├── 01_set-header/
│ │ │ └── main.go
│ │ ├── 02_URL/
│ │ │ └── main.go
│ │ ├── 03_URL/
│ │ │ └── main.go
│ │ ├── 04_URL/
│ │ │ └── main.go
│ │ └── 05_ServeFile/
│ │ └── main.go
│ ├── 47_templates/
│ │ ├── 01_text-templates/
│ │ │ ├── 01/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── 02/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── 03/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── 04/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── 05/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── 06/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── 07/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── 08/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── 09_function/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── 10_function/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ └── 11/
│ │ │ ├── main.go
│ │ │ └── tpl.gohtml
│ │ ├── 02_html-templates/
│ │ │ ├── 01/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── 02/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── 03/
│ │ │ │ ├── main.go
│ │ │ │ ├── tpl.gohtml
│ │ │ │ └── tpl2.gohtml
│ │ │ ├── 04/
│ │ │ │ ├── main.go
│ │ │ │ ├── tpl.gohtml
│ │ │ │ └── tpl2.gohtml
│ │ │ └── 05/
│ │ │ ├── main.go
│ │ │ └── templates/
│ │ │ ├── tpl.gohtml
│ │ │ └── tpl2.gohtml
│ │ └── x03_exercises/
│ │ ├── 01/
│ │ │ ├── hw.gohtml
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ ├── hw.gohtml
│ │ │ └── main.go
│ │ └── 03_template_csv-parse/
│ │ ├── hw.gohtml
│ │ ├── main.go
│ │ ├── parse/
│ │ │ └── parse.go
│ │ └── table.csv
│ ├── 48_passing-data/
│ │ ├── 01_URL-values/
│ │ │ └── main.go
│ │ ├── 02_form-values/
│ │ │ └── main.go
│ │ ├── 03_form-values/
│ │ │ └── main.go
│ │ ├── 04_form-values/
│ │ │ └── main.go
│ │ ├── 05_form-values/
│ │ │ └── main.go
│ │ ├── 06_form-values/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 07_form-data/
│ │ │ ├── form.gohtml
│ │ │ ├── main.go
│ │ │ └── sample.html
│ │ └── 08_form_file-upload/
│ │ ├── 01/
│ │ │ ├── form.gohtml
│ │ │ ├── main.go
│ │ │ └── sample.html
│ │ ├── 02/
│ │ │ ├── form.gohtml
│ │ │ ├── main.go
│ │ │ └── sample.html
│ │ ├── 03/
│ │ │ └── main.go
│ │ └── 04/
│ │ ├── file.txt
│ │ └── main.go
│ ├── 49_cookies-sessions/
│ │ ├── 01_set-cookie/
│ │ │ └── main.go
│ │ ├── 02_get-cookie/
│ │ │ └── main.go
│ │ ├── 03_sessions/
│ │ │ └── main.go
│ │ ├── 04_sessions/
│ │ │ └── main.go
│ │ ├── 05_sessions-HMAC/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 06_sessions_GORILLA/
│ │ │ └── main.go
│ │ ├── 07_cookies_show-visits/
│ │ │ └── main.go
│ │ ├── 08_log-in-out/
│ │ │ └── main.go
│ │ ├── 09_HTTPS-TLS/
│ │ │ └── main.go
│ │ ├── 10_HTTPS-TLS/
│ │ │ └── main.go
│ │ ├── 11_HTTPS-TLS/
│ │ │ └── main.go
│ │ └── 12_GORILLA_photo-blog/
│ │ ├── assets/
│ │ │ └── templates/
│ │ │ ├── index.html
│ │ │ └── login.html
│ │ └── main.go
│ ├── 50_exif/
│ │ └── main.go
│ ├── 51_appengine-introduction/
│ │ ├── 01_hello-world/
│ │ │ ├── app.yaml
│ │ │ └── hello.go
│ │ ├── 02_photo-blog_somewhat-crappy-code-FYI/
│ │ │ ├── app.yaml
│ │ │ ├── assets/
│ │ │ │ └── tpl/
│ │ │ │ ├── admin_login.gohtml
│ │ │ │ ├── admin_upload.gohtml
│ │ │ │ └── index.gohtml
│ │ │ └── photos.go
│ │ ├── 03_google-maps-api/
│ │ │ ├── app.yaml
│ │ │ ├── assets/
│ │ │ │ └── templates/
│ │ │ │ └── index.gohtml
│ │ │ └── hello.go
│ │ ├── 04_SERVICE_users/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ └── 05_GORILLA_photo-blog/
│ │ ├── app.yaml
│ │ ├── assets/
│ │ │ └── templates/
│ │ │ ├── index.html
│ │ │ └── login.html
│ │ └── main.go
│ ├── 52_memcache/
│ │ ├── 01_get-nil/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ ├── 02_set_get/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ ├── 03_expiration/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ ├── 04_increment/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ └── 05_memcache-session/
│ │ ├── 01i/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ ├── 02i/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ ├── 03i/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ ├── 04i/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ ├── 05i/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ └── 06_photo-blog_UNFINISHED/
│ │ ├── app.yaml
│ │ ├── assets/
│ │ │ └── templates/
│ │ │ ├── index.html
│ │ │ └── login.html
│ │ └── main.go
│ ├── 53_datastore/
│ │ ├── 00_appengine-documentation-example/
│ │ │ ├── 01_with-modifications/
│ │ │ │ ├── app.yaml
│ │ │ │ └── main.go
│ │ │ ├── 02_as-in-documentation/
│ │ │ │ ├── app.yaml
│ │ │ │ └── main.go
│ │ │ ├── 03_no-favicon/
│ │ │ │ ├── app.yaml
│ │ │ │ └── main.go
│ │ │ └── 04_no-favicon/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ ├── 01_partial-example_does-not-run/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ ├── 01_put/
│ │ │ │ ├── app.yaml
│ │ │ │ └── words.go
│ │ │ ├── 02/
│ │ │ │ ├── app.yaml
│ │ │ │ └── words.go
│ │ │ ├── 03_get/
│ │ │ │ ├── app.yaml
│ │ │ │ └── words.go
│ │ │ ├── 04_query-filter/
│ │ │ │ ├── app.yaml
│ │ │ │ └── words.go
│ │ │ └── 05_query-ancestor/
│ │ │ ├── app.yaml
│ │ │ └── words.go
│ │ ├── 03_users_datastore_exercise/
│ │ │ ├── app.yaml
│ │ │ ├── main.go
│ │ │ └── templates/
│ │ │ └── templates.gohtml
│ │ └── 04_julien-schmidt-router/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02-with-appengine/
│ │ ├── app.yaml
│ │ └── main.go
│ ├── 54_AJAX/
│ │ ├── 01/
│ │ │ ├── index.html
│ │ │ └── test.html
│ │ └── 02_users_datastore_exercise_AJAX/
│ │ ├── app.yaml
│ │ ├── main.go
│ │ └── templates/
│ │ └── templates.gohtml
│ ├── 55_todo-list/
│ │ ├── 01v_content-editable/
│ │ │ ├── app.yaml
│ │ │ ├── assets/
│ │ │ │ └── templates/
│ │ │ │ └── index.html
│ │ │ └── main.go
│ │ └── 02v_input/
│ │ ├── app.yaml
│ │ ├── assets/
│ │ │ └── templates/
│ │ │ └── index.html
│ │ └── main.go
│ ├── 56_twitter/
│ │ ├── 01_ux_design/
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── reset.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ └── home.html
│ │ ├── 02_ListenAndServe/
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── reset.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ └── home.html
│ │ ├── 03_error-handling/
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── reset.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ └── home.html
│ │ ├── 04_template_abstraction/
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── reset.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── footer.html
│ │ │ ├── header.html
│ │ │ └── home.html
│ │ ├── 05_document/
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── reset.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── footer.html
│ │ │ ├── header.html
│ │ │ └── home.html
│ │ ├── 06_document/
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── reset.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── footer.html
│ │ │ ├── header.html
│ │ │ └── home.html
│ │ ├── 07_app-engine/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── reset.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── footer.html
│ │ │ ├── header.html
│ │ │ └── home.html
│ │ ├── 08_julien-schmidt/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── reset.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── footer.html
│ │ │ ├── header.html
│ │ │ └── home.html
│ │ ├── 09_login-form/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── temp/
│ │ │ │ └── tempLogin.html
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── footer.html
│ │ │ ├── header.html
│ │ │ ├── header2.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 10_signup-form-validate/
│ │ │ ├── 01v_form-validation/
│ │ │ │ ├── app.yaml
│ │ │ │ ├── doc.go
│ │ │ │ ├── main.go
│ │ │ │ ├── public/
│ │ │ │ │ └── css/
│ │ │ │ │ ├── login.css
│ │ │ │ │ ├── reset.css
│ │ │ │ │ ├── signup.css
│ │ │ │ │ └── styles.css
│ │ │ │ ├── temp/
│ │ │ │ │ ├── tempLogin.html
│ │ │ │ │ ├── tempSignup.html
│ │ │ │ │ └── test-js.html
│ │ │ │ └── templates/
│ │ │ │ └── html/
│ │ │ │ ├── footer.html
│ │ │ │ ├── header.html
│ │ │ │ ├── header2.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ └── signup.html
│ │ │ └── 02v_datastore-put/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── temp/
│ │ │ │ ├── tempLogin.html
│ │ │ │ ├── tempSignup.html
│ │ │ │ └── test-js.html
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── footer.html
│ │ │ ├── header.html
│ │ │ ├── header2.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 11_HTTPS-TLS/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── err_main.tmp
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── footer.html
│ │ │ ├── header.html
│ │ │ ├── header2.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 12_error-handling/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── footer.html
│ │ │ ├── header.html
│ │ │ ├── header2.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 13_login_unfinished/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── footer.html
│ │ │ ├── header.html
│ │ │ ├── header2.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 14_code-review/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 15_memcache-home/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 16_abstract-memcache-code/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 17_memcache-templates/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── memcache.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 18_abstract-API-Model/
│ │ │ ├── API/
│ │ │ │ └── users.go
│ │ │ ├── IMPORTANT-READ-ME.txt
│ │ │ ├── Memcache/
│ │ │ │ └── templates.go
│ │ │ ├── Model/
│ │ │ │ └── users.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 19_abstract-API-Model_AE-fix/
│ │ │ ├── API/
│ │ │ │ └── users.go
│ │ │ ├── App/
│ │ │ │ ├── app.yaml
│ │ │ │ ├── doc.go
│ │ │ │ ├── main.go
│ │ │ │ ├── public/
│ │ │ │ │ └── css/
│ │ │ │ │ ├── login.css
│ │ │ │ │ ├── reset.css
│ │ │ │ │ ├── signup.css
│ │ │ │ │ └── styles.css
│ │ │ │ └── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ └── signup.html
│ │ │ ├── Memcache/
│ │ │ │ └── templates.go
│ │ │ └── Model/
│ │ │ └── users.go
│ │ ├── 20_reverting_to_only_package-main/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── memcache.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ └── signup.html
│ │ │ └── userCreation.go
│ │ ├── 21_set-cookie_no-PATH/
│ │ │ ├── IMPORTANT-TO-READ.txt
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── memcache.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ └── signup.html
│ │ │ └── userCreation.go
│ │ ├── 22_set-cookie_PATH/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── memcache.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ └── signup.html
│ │ │ └── userCreation.go
│ │ ├── 23_set-cookie-UUID/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── memcache.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ └── signup.html
│ │ │ └── userCreation.go
│ │ ├── 24_session/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── memcache.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ └── signup.html
│ │ │ └── userCreation.go
│ │ ├── 25_session-all-pages/
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ └── signup.html
│ │ │ └── userCreation.go
│ │ ├── 26_login/
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── notes.txt
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 27_logout/
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 28_code-review/
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 29_password-encryption/
│ │ │ ├── READ-ME.txt
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 30_turn-off-memcache/
│ │ │ ├── READ-ME.txt
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ └── signup.html
│ │ ├── 31_modal-post-tweet/
│ │ │ ├── README.txt
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── modal-tweet.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ ├── modal-tweet.html
│ │ │ └── signup.html
│ │ ├── 32_tweets/
│ │ │ ├── READ-ME.txt
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── modal-tweet.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ └── templates/
│ │ │ └── html/
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ ├── modal-tweet.html
│ │ │ └── signup.html
│ │ ├── 33_display-all-tweets/
│ │ │ ├── READ-ME.txt
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── modal-tweet.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ ├── modal-tweet.html
│ │ │ │ └── signup.html
│ │ │ └── tweets.go
│ │ ├── 34_humanize/
│ │ │ ├── READ-ME.txt
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── modal-tweet.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ ├── modal-tweet.html
│ │ │ │ └── signup.html
│ │ │ └── tweets.go
│ │ ├── 35_schmidt-params/
│ │ │ ├── 01/
│ │ │ │ └── main.go
│ │ │ ├── 02/
│ │ │ │ └── main.go
│ │ │ ├── 03/
│ │ │ │ └── main.go
│ │ │ ├── 04/
│ │ │ │ └── main.go
│ │ │ └── 05/
│ │ │ └── main.go
│ │ ├── 36_user-tweets/
│ │ │ ├── READ-ME.txt
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── index.yaml
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── modal-tweet.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ ├── modal-tweet.html
│ │ │ │ └── signup.html
│ │ │ └── tweets.go
│ │ ├── 37_other-implementations/
│ │ │ ├── 01_daniel/
│ │ │ │ ├── app.yaml
│ │ │ │ ├── data.go
│ │ │ │ ├── email.go
│ │ │ │ ├── index.yaml
│ │ │ │ ├── main.go
│ │ │ │ ├── public/
│ │ │ │ │ ├── makeTweet.js
│ │ │ │ │ └── style.css
│ │ │ │ └── templates/
│ │ │ │ ├── createProfile.gohtml
│ │ │ │ ├── index.gohtml
│ │ │ │ ├── login.gohtml
│ │ │ │ ├── profile.gohtml
│ │ │ │ └── tweet.gohtml
│ │ │ ├── 02_tommy/
│ │ │ │ ├── README.md
│ │ │ │ ├── app.yaml
│ │ │ │ ├── assets/
│ │ │ │ │ └── scripts/
│ │ │ │ │ └── main.js
│ │ │ │ ├── data.go
│ │ │ │ ├── handlers.go
│ │ │ │ ├── main.go
│ │ │ │ ├── render.go
│ │ │ │ └── templates/
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ └── profile.html
│ │ │ └── 03_t/
│ │ │ ├── app.yaml
│ │ │ ├── data.go
│ │ │ ├── index.yaml
│ │ │ ├── public/
│ │ │ │ ├── css/
│ │ │ │ │ └── reset.css
│ │ │ │ └── js/
│ │ │ │ └── make-post.js
│ │ │ ├── routes.go
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── footer.html
│ │ │ │ ├── header.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ └── profile.html
│ │ │ ├── templates.go
│ │ │ └── temporary/
│ │ │ ├── modal-dialog.html
│ │ │ ├── temp_home.html
│ │ │ ├── temp_login.html
│ │ │ └── temp_profile.html
│ │ ├── 38_follow/
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── following.go
│ │ │ ├── index.yaml
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── modal-tweet.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ ├── modal-tweet.html
│ │ │ │ ├── signup.html
│ │ │ │ └── user.html
│ │ │ └── tweets.go
│ │ ├── 39_unfollow/
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── following.go
│ │ │ ├── index.yaml
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── modal-tweet.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ ├── modal-tweet.html
│ │ │ │ ├── signup.html
│ │ │ │ └── user.html
│ │ │ └── tweets.go
│ │ ├── 40_send-email/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ ├── 41_twitter-send-email/
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── email.go
│ │ │ ├── following.go
│ │ │ ├── index.yaml
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── modal-tweet.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ ├── modal-tweet.html
│ │ │ │ ├── signup.html
│ │ │ │ └── user.html
│ │ │ └── tweets.go
│ │ ├── 42_following/
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── email.go
│ │ │ ├── following.go
│ │ │ ├── index.yaml
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── modal-tweet.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── follow.html
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ ├── modal-tweet.html
│ │ │ │ ├── signup.html
│ │ │ │ └── user.html
│ │ │ └── tweets.go
│ │ ├── 43_following-me/
│ │ │ ├── api.go
│ │ │ ├── app.yaml
│ │ │ ├── doc.go
│ │ │ ├── email.go
│ │ │ ├── following.go
│ │ │ ├── index.yaml
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── public/
│ │ │ │ └── css/
│ │ │ │ ├── login.css
│ │ │ │ ├── modal-tweet.css
│ │ │ │ ├── reset.css
│ │ │ │ ├── signup.css
│ │ │ │ └── styles.css
│ │ │ ├── session.go
│ │ │ ├── template.go
│ │ │ ├── templates/
│ │ │ │ └── html/
│ │ │ │ ├── follow.html
│ │ │ │ ├── followingme.html
│ │ │ │ ├── headersFooters.html
│ │ │ │ ├── home.html
│ │ │ │ ├── login.html
│ │ │ │ ├── modal-tweet.html
│ │ │ │ ├── signup.html
│ │ │ │ └── user.html
│ │ │ └── tweets.go
│ │ └── 44_code-review/
│ │ ├── api.go
│ │ ├── app.yaml
│ │ ├── doc.go
│ │ ├── email.go
│ │ ├── following.go
│ │ ├── index.yaml
│ │ ├── main.go
│ │ ├── model.go
│ │ ├── public/
│ │ │ └── css/
│ │ │ ├── login.css
│ │ │ ├── modal-tweet.css
│ │ │ ├── reset.css
│ │ │ ├── signup.css
│ │ │ └── styles.css
│ │ ├── session.go
│ │ ├── template.go
│ │ ├── templates/
│ │ │ └── html/
│ │ │ ├── follow.html
│ │ │ ├── followingme.html
│ │ │ ├── headersFooters.html
│ │ │ ├── home.html
│ │ │ ├── login.html
│ │ │ ├── modal-tweet.html
│ │ │ ├── signup.html
│ │ │ └── user.html
│ │ └── tweets.go
│ ├── 57_appengine-channel/
│ │ ├── 01_basic/
│ │ │ ├── app.yaml
│ │ │ └── channel.go
│ │ └── 02_chat-room/
│ │ ├── app.yaml
│ │ ├── handlers.go
│ │ ├── public/
│ │ │ ├── index.html
│ │ │ ├── main.css
│ │ │ └── main.js
│ │ ├── room.go
│ │ └── routes.go
│ ├── 58_appengine-search/
│ │ ├── app.yaml
│ │ └── search.go
│ ├── 59_appengine-GCS-storage/
│ │ ├── 00_GCS-setup/
│ │ │ └── 00_GCS-setup.txt
│ │ ├── 01_NewWriter_PEM-auth/
│ │ │ ├── app.yaml
│ │ │ └── storage.go
│ │ ├── 02_NewWriter_JSON-auth/
│ │ │ ├── README.txt
│ │ │ ├── app.yaml
│ │ │ └── storage.go
│ │ └── 03_put-get-list_JSON-auth/
│ │ ├── README.txt
│ │ ├── app.yaml
│ │ └── storage.go
│ ├── 60_movie-website/
│ │ ├── 01_search/
│ │ │ ├── app.yaml
│ │ │ ├── index.go
│ │ │ ├── newmovie.go
│ │ │ ├── public/
│ │ │ │ ├── main.css
│ │ │ │ └── opensearch.xml
│ │ │ ├── routes.go
│ │ │ ├── search.go
│ │ │ ├── templates/
│ │ │ │ ├── index.gohtml
│ │ │ │ ├── layout.gohtml
│ │ │ │ ├── new-movie.gohtml
│ │ │ │ └── search.gohtml
│ │ │ ├── templates.go
│ │ │ └── types.go
│ │ └── 02_image-upload-GCS/
│ │ ├── README.txt
│ │ ├── app.yaml
│ │ ├── index.go
│ │ ├── newmovie.go
│ │ ├── public/
│ │ │ ├── main.css
│ │ │ └── opensearch.xml
│ │ ├── routes.go
│ │ ├── search.go
│ │ ├── storage.go
│ │ ├── templates/
│ │ │ ├── index.gohtml
│ │ │ ├── layout.gohtml
│ │ │ ├── new-movie.gohtml
│ │ │ └── search.gohtml
│ │ ├── templates.go
│ │ └── types.go
│ ├── 61_http-giffy/
│ │ ├── app.yaml
│ │ └── http.go
│ ├── 62_self-destructing-message/
│ │ ├── 01/
│ │ │ ├── app.yaml
│ │ │ └── routes.go
│ │ └── 02_crypto/
│ │ ├── 01_nonce/
│ │ │ └── main.go
│ │ ├── 02_encrypt/
│ │ │ └── main.go
│ │ ├── 03_decrypt/
│ │ │ └── main.go
│ │ └── 04_complete/
│ │ ├── app.yaml
│ │ └── routes.go
│ ├── 63_GCS-filebrowser/
│ │ ├── README.txt
│ │ ├── app.yaml
│ │ ├── routes.go
│ │ ├── session.go
│ │ ├── storage.go
│ │ └── templates/
│ │ ├── browse.html
│ │ └── index.html
│ ├── 64_csv-example/
│ │ ├── 01/
│ │ │ ├── app.yaml
│ │ │ ├── routes.go
│ │ │ └── stats.go
│ │ └── 02/
│ │ ├── app.yaml
│ │ ├── routes.go
│ │ └── stats.go
│ ├── 65_accepting-credit-cards/
│ │ ├── 01_basic-setup/
│ │ │ ├── app.yaml
│ │ │ ├── routes.go
│ │ │ └── templates/
│ │ │ └── index.gohtml
│ │ ├── 02_customizing_UI/
│ │ │ ├── app.yaml
│ │ │ ├── routes.go
│ │ │ └── templates/
│ │ │ └── index.gohtml
│ │ ├── 03_stripe-token/
│ │ │ ├── app.yaml
│ │ │ ├── routes.go
│ │ │ └── templates/
│ │ │ └── index.gohtml
│ │ ├── 04_err-because-of-app-engine/
│ │ │ ├── app.yaml
│ │ │ ├── routes.go
│ │ │ ├── stripe.go
│ │ │ └── templates/
│ │ │ └── index.gohtml
│ │ ├── 05_charging/
│ │ │ ├── app.yaml
│ │ │ ├── routes.go
│ │ │ ├── stripe.go
│ │ │ └── templates/
│ │ │ └── index.gohtml
│ │ ├── 06_idempotent/
│ │ │ ├── app.yaml
│ │ │ ├── routes.go
│ │ │ ├── stripe.go
│ │ │ └── templates/
│ │ │ └── index.gohtml
│ │ └── 07_complete/
│ │ ├── app.yaml
│ │ ├── routes.go
│ │ ├── stripe.go
│ │ └── templates/
│ │ └── index.gohtml
│ ├── 66_authentication_OAUTH/
│ │ ├── 01_app-engine-auth_REVIEW/
│ │ │ ├── app.yaml
│ │ │ └── main.go
│ │ ├── 02_manual-auth/
│ │ │ ├── 01_cookie_REVIEW/
│ │ │ │ └── main.go
│ │ │ ├── 02_gorilla_REVIEW_photo-blog/
│ │ │ │ ├── 01_simple/
│ │ │ │ │ └── main.go
│ │ │ │ └── 02_photo-blog/
│ │ │ │ ├── assets/
│ │ │ │ │ └── templates/
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── login.html
│ │ │ │ └── main.go
│ │ │ ├── 03_memcache_REVIEW_twitter/
│ │ │ │ ├── README.txt
│ │ │ │ ├── api.go
│ │ │ │ ├── app.yaml
│ │ │ │ ├── doc.go
│ │ │ │ ├── email.go
│ │ │ │ ├── following.go
│ │ │ │ ├── index.yaml
│ │ │ │ ├── main.go
│ │ │ │ ├── model.go
│ │ │ │ ├── public/
│ │ │ │ │ └── css/
│ │ │ │ │ ├── login.css
│ │ │ │ │ ├── modal-tweet.css
│ │ │ │ │ ├── reset.css
│ │ │ │ │ ├── signup.css
│ │ │ │ │ └── styles.css
│ │ │ │ ├── session.go
│ │ │ │ ├── template.go
│ │ │ │ ├── templates/
│ │ │ │ │ └── html/
│ │ │ │ │ ├── follow.html
│ │ │ │ │ ├── followingme.html
│ │ │ │ │ ├── headersFooters.html
│ │ │ │ │ ├── home.html
│ │ │ │ │ ├── login.html
│ │ │ │ │ ├── modal-tweet.html
│ │ │ │ │ ├── signup.html
│ │ │ │ │ └── user.html
│ │ │ │ └── tweets.go
│ │ │ └── 04_bcrypt/
│ │ │ ├── 01/
│ │ │ │ ├── README.txt
│ │ │ │ └── main.go
│ │ │ └── 02/
│ │ │ └── main.go
│ │ ├── 03_oauth-github/
│ │ │ ├── 00_readme/
│ │ │ │ └── README.txt
│ │ │ ├── 01_authorization-code/
│ │ │ │ ├── app.yaml
│ │ │ │ ├── login.go
│ │ │ │ └── session.go
│ │ │ ├── 02_access-token/
│ │ │ │ ├── app.yaml
│ │ │ │ ├── login.go
│ │ │ │ └── session.go
│ │ │ ├── 03_url-ParseQuery/
│ │ │ │ ├── app.yaml
│ │ │ │ ├── login.go
│ │ │ │ └── session.go
│ │ │ ├── 04_user-email/
│ │ │ │ ├── app.yaml
│ │ │ │ ├── login.go
│ │ │ │ └── session.go
│ │ │ ├── 05_configuration_scheduled-tasks_cron/
│ │ │ │ ├── app.yaml
│ │ │ │ ├── cron.yaml
│ │ │ │ ├── login.go
│ │ │ │ └── scheduled.go
│ │ │ └── 06-complete/
│ │ │ ├── app.yaml
│ │ │ ├── cron.yaml
│ │ │ ├── github.go
│ │ │ ├── login.go
│ │ │ ├── scheduled.go
│ │ │ └── session.go
│ │ ├── 04_oauth-twitter/
│ │ │ └── 00_readme/
│ │ │ └── README.txt
│ │ ├── 05_oauth-facebook/
│ │ │ └── 00_readme/
│ │ │ └── README.txt
│ │ ├── 05_oauth-google/
│ │ │ ├── 00_readme/
│ │ │ │ └── README.txt
│ │ │ ├── app.yaml
│ │ │ ├── routes.go
│ │ │ └── session.go
│ │ ├── 06_oauth-linkedin/
│ │ │ └── 00_readme/
│ │ │ └── README.txt
│ │ ├── 07_oauth-vk/
│ │ │ └── 00_readme/
│ │ │ └── README.txt
│ │ └── 08_oauth-dropbox/
│ │ ├── 00_readme/
│ │ │ └── README.txt
│ │ ├── app.yaml
│ │ ├── routes.go
│ │ └── session.go
│ ├── 67_digital-ocean_aerospike/
│ │ ├── 01_helloWorld/
│ │ │ └── testServer.go
│ │ ├── 02_fullsite/
│ │ │ ├── .gitignore
│ │ │ ├── main.go
│ │ │ └── templates/
│ │ │ ├── create.gohtml
│ │ │ ├── index.gohtml
│ │ │ └── login.gohtml
│ │ ├── 03-aerospike/
│ │ │ ├── main.go
│ │ │ └── templates/
│ │ │ ├── create.gohtml
│ │ │ ├── index.gohtml
│ │ │ └── login.gohtml
│ │ └── README.md
│ ├── 68_task-queue/
│ │ ├── 01_delay/
│ │ │ ├── app.yaml
│ │ │ ├── delayed.go
│ │ │ └── routes.go
│ │ ├── 02_delay-cron/
│ │ │ ├── app.yaml
│ │ │ ├── cron.yaml
│ │ │ ├── delayed.go
│ │ │ ├── routes.go
│ │ │ └── scheduled.go
│ │ ├── 03_github/
│ │ │ ├── app.yaml
│ │ │ ├── github.go
│ │ │ ├── login.go
│ │ │ └── session.go
│ │ ├── 04_github-goroutines/
│ │ │ ├── app.yaml
│ │ │ ├── github.go
│ │ │ ├── login.go
│ │ │ └── session.go
│ │ └── 05_github-cron/
│ │ ├── app.yaml
│ │ ├── cron.yaml
│ │ ├── github.go
│ │ ├── login.go
│ │ ├── scheduled.go
│ │ └── session.go
│ ├── 90_append-to-file/
│ │ ├── 01-get-files/
│ │ │ └── main.go
│ │ └── 02-apply/
│ │ └── main.go
│ ├── 97_temp/
│ │ ├── 01/
│ │ │ └── main.go
│ │ └── 02/
│ │ ├── 02
│ │ └── main.go
│ ├── 98-good-student-code/
│ │ └── daniel/
│ │ ├── Week1/
│ │ │ ├── blog/
│ │ │ │ ├── blog.css
│ │ │ │ └── blog.html
│ │ │ ├── fullscreen/
│ │ │ │ ├── fullscreen-style.css
│ │ │ │ └── fullscreen.html
│ │ │ ├── google/
│ │ │ │ ├── google.css
│ │ │ │ └── google.html
│ │ │ └── treehouse/
│ │ │ ├── treehouse.css
│ │ │ └── treehouse.html
│ │ ├── Week10/
│ │ │ ├── dropbox-api/
│ │ │ │ ├── app.yaml
│ │ │ │ ├── routes.go
│ │ │ │ └── session.go
│ │ │ ├── filebrowser/
│ │ │ │ ├── app.yaml
│ │ │ │ ├── browse.go
│ │ │ │ ├── credentials.go
│ │ │ │ ├── public/
│ │ │ │ │ └── styles.css
│ │ │ │ ├── routes.go
│ │ │ │ ├── session.go
│ │ │ │ ├── storage.go
│ │ │ │ └── templates/
│ │ │ │ ├── browse.gohtml
│ │ │ │ └── credentials.gohtml
│ │ │ └── payment/
│ │ │ ├── app.yaml
│ │ │ ├── routes.go
│ │ │ ├── stripe.go
│ │ │ └── templates/
│ │ │ └── index.gohtml
│ │ ├── Week2/
│ │ │ ├── backgroundPreview/
│ │ │ │ ├── backgroundPreview.css
│ │ │ │ ├── backgroundPreview.html
│ │ │ │ └── backgroundPreview.js
│ │ │ ├── changingBackground/
│ │ │ │ ├── changingBackground.css
│ │ │ │ ├── changingBackground.html
│ │ │ │ └── changingBackground.js
│ │ │ ├── destructButton/
│ │ │ │ ├── destructButton.css
│ │ │ │ ├── destructButton.html
│ │ │ │ └── destructButton.js
│ │ │ ├── generatedList/
│ │ │ │ ├── script.js
│ │ │ │ └── test.html
│ │ │ ├── imageListJavascript/
│ │ │ │ └── imageListJavascript.html
│ │ │ ├── magic8ball/
│ │ │ │ ├── magic-ball.css
│ │ │ │ ├── magic-ball.js
│ │ │ │ └── magic8ball.html
│ │ │ └── whackAMole/
│ │ │ ├── whackamole.css
│ │ │ ├── whackamole.html
│ │ │ └── whackamole.js
│ │ ├── Week3/
│ │ │ ├── audioPlayer/
│ │ │ │ ├── audioPlayer.css
│ │ │ │ ├── audioPlayer.html
│ │ │ │ └── audioPlayer.js
│ │ │ ├── hoverPreview/
│ │ │ │ ├── hoverPreview.css
│ │ │ │ ├── hoverPreview.html
│ │ │ │ └── hoverPreview.js
│ │ │ └── loadImage/
│ │ │ ├── loadImage.css
│ │ │ ├── loadImage.html
│ │ │ └── loadImage.js
│ │ ├── Week4/
│ │ │ ├── angularAjax/
│ │ │ │ ├── data.json
│ │ │ │ ├── gulpfile.js
│ │ │ │ ├── index.html
│ │ │ │ └── script.js
│ │ │ ├── chat/
│ │ │ │ └── chat.html
│ │ │ ├── firebaseExample/
│ │ │ │ └── firebaseExample.html
│ │ │ ├── flickrFeed/
│ │ │ │ ├── flickr.css
│ │ │ │ ├── flickr.html
│ │ │ │ ├── flickr.js
│ │ │ │ ├── gulpfile.js
│ │ │ │ └── package.json
│ │ │ ├── liveSearch/
│ │ │ │ ├── data.json
│ │ │ │ ├── gulpfile.js
│ │ │ │ ├── liveSearch.css
│ │ │ │ ├── liveSearch.html
│ │ │ │ ├── liveSearch.js
│ │ │ │ └── package.json
│ │ │ ├── mustacheTemplate/
│ │ │ │ ├── data.json
│ │ │ │ ├── gulpfile.js
│ │ │ │ ├── mustache.html
│ │ │ │ ├── mustache.js
│ │ │ │ └── package.json
│ │ │ └── routing/
│ │ │ ├── app.js
│ │ │ ├── artists.js
│ │ │ ├── detail.html
│ │ │ ├── list.html
│ │ │ ├── routing.html
│ │ │ └── style.css
│ │ ├── Week5/
│ │ │ └── web-components-training-exercises/
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── breaking-shadow-dom-polyfill/
│ │ │ │ ├── another-component/
│ │ │ │ │ └── index.html
│ │ │ │ ├── index.html
│ │ │ │ ├── my-component/
│ │ │ │ │ └── index.html
│ │ │ │ └── webcomponents.js
│ │ │ ├── css-patterns-input-label-pairs/
│ │ │ │ └── index.html
│ │ │ ├── css-patterns-media-object/
│ │ │ │ └── index.html
│ │ │ ├── css-patterns-tabs/
│ │ │ │ └── index.html
│ │ │ ├── general-components/
│ │ │ │ ├── hello-badge/
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── styles.css
│ │ │ │ ├── readme.md
│ │ │ │ ├── tabs/
│ │ │ │ │ └── index.html
│ │ │ │ └── waiting-spinner/
│ │ │ │ ├── index.html
│ │ │ │ └── styles.css
│ │ │ ├── hello-web-components/
│ │ │ │ ├── index.html
│ │ │ │ └── my-first-web-component/
│ │ │ │ └── my-first-web-component.html
│ │ │ ├── intro-shadow-dom/
│ │ │ │ └── index.html
│ │ │ ├── nesting-components/
│ │ │ │ ├── accordion_component/
│ │ │ │ │ ├── script.js
│ │ │ │ │ └── styles.css
│ │ │ │ └── index.html
│ │ │ ├── progress-bar-component/
│ │ │ │ ├── index.html
│ │ │ │ └── script.js
│ │ │ ├── styleguide/
│ │ │ │ ├── components/
│ │ │ │ │ ├── accordion.html
│ │ │ │ │ ├── badge.html
│ │ │ │ │ ├── blink.html
│ │ │ │ │ ├── button.html
│ │ │ │ │ ├── slider.html
│ │ │ │ │ └── spinner.html
│ │ │ │ ├── createElement.js
│ │ │ │ └── index.html
│ │ │ └── ui-libraries/
│ │ │ ├── dogo-toolkit/
│ │ │ │ └── index.html
│ │ │ └── jquery-ui/
│ │ │ └── index.html
│ │ ├── Week6/
│ │ │ ├── 1-text-editors/
│ │ │ │ ├── 1-emmet.html
│ │ │ │ └── 2-emmet.html
│ │ │ ├── 2-browser-devtools/
│ │ │ │ ├── zlickr/
│ │ │ │ │ ├── css/
│ │ │ │ │ │ ├── gallery-grid.css
│ │ │ │ │ │ ├── gallery.css
│ │ │ │ │ │ └── pure.css
│ │ │ │ │ └── index.html
│ │ │ │ ├── zmail/
│ │ │ │ │ ├── css/
│ │ │ │ │ │ ├── email.css
│ │ │ │ │ │ └── pure.css
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── js/
│ │ │ │ │ ├── count.js
│ │ │ │ │ ├── menu.js
│ │ │ │ │ └── spam.js
│ │ │ │ └── zordpress/
│ │ │ │ ├── css/
│ │ │ │ │ ├── blog.css
│ │ │ │ │ ├── main-grid.css
│ │ │ │ │ └── pure.css
│ │ │ │ ├── index.html
│ │ │ │ └── js/
│ │ │ │ └── save.js
│ │ │ ├── 3-html5/
│ │ │ │ ├── 1-detection/
│ │ │ │ │ └── index.html
│ │ │ │ ├── 2-structure/
│ │ │ │ │ ├── 1-past.html
│ │ │ │ │ └── 2-today.html
│ │ │ │ ├── 3-audio/
│ │ │ │ │ └── index.html
│ │ │ │ ├── 4-video/
│ │ │ │ │ └── index.html
│ │ │ │ ├── 5-input/
│ │ │ │ │ └── index.html
│ │ │ │ ├── 6-mark/
│ │ │ │ │ └── index.html
│ │ │ │ └── 7-progress/
│ │ │ │ └── index.html
│ │ │ ├── 4-js/
│ │ │ │ ├── 1-jquery/
│ │ │ │ │ └── index.html
│ │ │ │ ├── 2-audio/
│ │ │ │ │ └── index.html
│ │ │ │ ├── 3-video/
│ │ │ │ │ └── index.html
│ │ │ │ ├── 4-form/
│ │ │ │ │ └── index.html
│ │ │ │ ├── 5-storage/
│ │ │ │ │ ├── local.html
│ │ │ │ │ └── session.html
│ │ │ │ ├── 6-geolocation/
│ │ │ │ │ └── index.html
│ │ │ │ ├── 7-usermedia/
│ │ │ │ │ └── index.html
│ │ │ │ ├── 8-dragndrop/
│ │ │ │ │ └── index.html
│ │ │ │ └── 9-canvas/
│ │ │ │ └── index.html
│ │ │ ├── 5-web-components/
│ │ │ │ ├── 0-proto/
│ │ │ │ │ └── index.html
│ │ │ │ ├── 1-custom-elements/
│ │ │ │ │ ├── 1-index.html
│ │ │ │ │ └── 2-fcc-location.html
│ │ │ │ ├── 2-html-templates/
│ │ │ │ │ ├── 1-index.html
│ │ │ │ │ ├── 2-fcc-logo.html
│ │ │ │ │ └── 3-airport.html
│ │ │ │ ├── 3-shadow-dom/
│ │ │ │ │ ├── 1-index.html
│ │ │ │ │ └── 2-fcc-button.html
│ │ │ │ └── 4-html-imports/
│ │ │ │ ├── 1-component.html
│ │ │ │ ├── 1-index.html
│ │ │ │ ├── 2-index.html
│ │ │ │ └── 2-toc.html
│ │ │ ├── 6-collapse/
│ │ │ │ ├── 2-index.html
│ │ │ │ └── bower.json
│ │ │ ├── 7-polymer/
│ │ │ │ ├── 1-registering/
│ │ │ │ │ ├── 1-index.html
│ │ │ │ │ ├── 1-plain.html
│ │ │ │ │ └── 1-polymer.html
│ │ │ │ ├── 2-lifecycle/
│ │ │ │ │ ├── 1-index.html
│ │ │ │ │ ├── 2-index.html
│ │ │ │ │ ├── 2-plain.html
│ │ │ │ │ └── 2-polymer.html
│ │ │ │ ├── 3-properties/
│ │ │ │ │ ├── 1-index.html
│ │ │ │ │ ├── 1-polymer.html
│ │ │ │ │ ├── 2-index.html
│ │ │ │ │ └── 2-polymer.html
│ │ │ │ ├── 4-local-dom/
│ │ │ │ │ ├── 1-index.html
│ │ │ │ │ ├── 1-polymer.html
│ │ │ │ │ ├── 2-index.html
│ │ │ │ │ └── 2-polymer.html
│ │ │ │ └── 5-data-binding/
│ │ │ │ ├── 1-index.html
│ │ │ │ ├── 1-polymer.html
│ │ │ │ ├── 2-index.html
│ │ │ │ └── 2-polymer.html
│ │ │ └── 8-bonus/
│ │ │ ├── index.html
│ │ │ └── style.html
│ │ ├── Week7/
│ │ │ ├── Converter/
│ │ │ │ └── main.go
│ │ │ ├── Hello/
│ │ │ │ └── main.go
│ │ │ ├── Loops/
│ │ │ │ └── main.go
│ │ │ ├── capitalize/
│ │ │ │ ├── main.go
│ │ │ │ └── test.txt
│ │ │ ├── distanceConverter/
│ │ │ │ └── main.go
│ │ │ ├── findSmallest/
│ │ │ │ └── main.go
│ │ │ ├── monuments/
│ │ │ │ ├── City_of_Champaign_GPS_Control_Points.csv
│ │ │ │ ├── main.go
│ │ │ │ └── test.html
│ │ │ ├── my-cat/
│ │ │ │ ├── hello.txt
│ │ │ │ └── main.go
│ │ │ ├── my-md5/
│ │ │ │ └── main.go
│ │ │ ├── profileGenerator/
│ │ │ │ └── main.go
│ │ │ ├── rotate/
│ │ │ │ └── main.go
│ │ │ ├── wordCount/
│ │ │ │ ├── main.go
│ │ │ │ └── moby10b.txt
│ │ │ └── yahooFinantial/
│ │ │ ├── info.html
│ │ │ ├── main.go
│ │ │ └── table.csv
│ │ ├── Week8/
│ │ │ ├── chatRoom/
│ │ │ │ └── main.go
│ │ │ ├── colors/
│ │ │ │ └── main.go
│ │ │ ├── csv-convert/
│ │ │ │ ├── main.go
│ │ │ │ └── table.csv
│ │ │ ├── customHttpServer/
│ │ │ │ └── main.go
│ │ │ ├── echoServer/
│ │ │ │ └── main.go
│ │ │ ├── firstAppEngine/
│ │ │ │ ├── app.yaml
│ │ │ │ └── hello.go
│ │ │ ├── firstTemplate/
│ │ │ │ ├── main.go
│ │ │ │ └── tpl.gohtml
│ │ │ ├── formExample/
│ │ │ │ └── main.go
│ │ │ ├── httpAnimals/
│ │ │ │ └── main.go
│ │ │ ├── json-example/
│ │ │ │ ├── data.json
│ │ │ │ └── main.go
│ │ │ ├── photoBlog/
│ │ │ │ ├── adminSite.gohtml
│ │ │ │ ├── app.yaml
│ │ │ │ ├── main.go
│ │ │ │ ├── mainSite.gohtml
│ │ │ │ └── style.css
│ │ │ ├── profile/
│ │ │ │ ├── app.yaml
│ │ │ │ ├── createProfile.gohtml
│ │ │ │ ├── main.go
│ │ │ │ └── viewProfile.gohtml
│ │ │ ├── redisDatabase/
│ │ │ │ └── main.go
│ │ │ ├── secureHello/
│ │ │ │ └── main.go
│ │ │ ├── static-http/
│ │ │ │ └── main.go
│ │ │ ├── testExample/
│ │ │ │ ├── example.go
│ │ │ │ └── example_test.go
│ │ │ └── todolist/
│ │ │ ├── app.yaml
│ │ │ ├── index.html
│ │ │ ├── index.yaml
│ │ │ ├── main.go
│ │ │ ├── script.js
│ │ │ └── style.css
│ │ └── Week9/
│ │ ├── chat-example/
│ │ │ ├── app.yaml
│ │ │ ├── handlers.go
│ │ │ ├── public/
│ │ │ │ ├── index.html
│ │ │ │ └── main.js
│ │ │ └── routes.go
│ │ ├── movie-search/
│ │ │ ├── app.yaml
│ │ │ ├── data.go
│ │ │ ├── details.go
│ │ │ ├── index.go
│ │ │ ├── index.yaml
│ │ │ ├── movie.go
│ │ │ ├── route.go
│ │ │ ├── search.go
│ │ │ ├── template.go
│ │ │ └── templates/
│ │ │ ├── addMovie.gohtml
│ │ │ ├── details.gohtml
│ │ │ ├── header.gohtml
│ │ │ ├── index.gohtml
│ │ │ ├── movie.gohtml
│ │ │ └── search.gohtml
│ │ └── storageExample/
│ │ ├── app.yaml
│ │ └── storage.go
│ └── 99_svcc/
│ ├── 01_string-to-html/
│ │ └── main.go
│ ├── 02_os-args/
│ │ └── main.go
│ ├── 03_text-template/
│ │ ├── main.go
│ │ └── tpl.gohtml
│ ├── 04_pipeline/
│ │ ├── main.go
│ │ └── tpl.gohtml
│ ├── 05_pipeline-range/
│ │ ├── main.go
│ │ └── tpl.gohtml
│ ├── 06_pipeline-range-else/
│ │ ├── main.go
│ │ └── tpl.gohtml
│ ├── 07_composition/
│ │ ├── main.go
│ │ └── tpl.gohtml
│ ├── 08_composition-conditional/
│ │ ├── main.go
│ │ └── tpl.gohtml
│ ├── 09_methods/
│ │ └── main.go
│ ├── 10_xss/
│ │ ├── index.html
│ │ ├── main.go
│ │ └── tpl.gohtml
│ ├── 11_html-templates/
│ │ ├── index.html
│ │ ├── main.go
│ │ └── tpl.gohtml
│ ├── 12_parsefiles/
│ │ ├── main.go
│ │ ├── tpl.gohtml
│ │ └── tpl2.gohtml
│ ├── 13_ParseGlob/
│ │ ├── main.go
│ │ └── templates/
│ │ ├── tpl.gohtml
│ │ └── tpl2.gohtml
│ ├── 14_tcp_echo-server/
│ │ └── main.go
│ ├── 15_tcp_echo-server/
│ │ └── main.go
│ ├── 16_redis-clone_step-2/
│ │ └── main.go
│ ├── 17_redis-clone_step-5/
│ │ └── main.go
│ ├── 18_rot13/
│ │ └── main.go
│ ├── 19_DIY_http-server_request-line_headers/
│ │ └── main.go
│ ├── 20_DIY_http-server_step-01/
│ │ └── main.go
│ ├── 21_DIY_http-server_step-02/
│ │ └── main.go
│ ├── 22_DIY_http-server_step-03/
│ │ └── main.go
│ ├── 23_DIY_http-server_step-04/
│ │ └── main.go
│ ├── 24_http-server_ServeMux/
│ │ └── main.go
│ ├── 25_http-server_DefaultServeMux/
│ │ └── main.go
│ ├── 26_serving-files_io-Copy/
│ │ └── main.go
│ ├── 27_serving-files_ServeContent/
│ │ └── main.go
│ ├── 28_serving-files_ServeFile/
│ │ └── main.go
│ ├── 29_serving-files_FileServer/
│ │ └── main.go
│ ├── 30_serving-files_FileServer/
│ │ └── main.go
│ ├── 31_serving-files_FileServer/
│ │ └── main.go
│ ├── 32_static-FileServer/
│ │ ├── assets/
│ │ │ ├── images/
│ │ │ │ └── home/
│ │ │ │ └── imgres.html
│ │ │ └── stylesheets/
│ │ │ └── main.css
│ │ ├── button.html
│ │ ├── floats_in_practice.html
│ │ ├── index.html
│ │ ├── main.go
│ │ ├── register.html
│ │ ├── schedule.html
│ │ ├── speakers.html
│ │ ├── sponsors.html
│ │ └── venue.html
│ ├── 33_set-cookie/
│ │ └── main.go
│ ├── 34_get-cookie/
│ │ └── main.go
│ ├── 35_favicon-bye-bye/
│ │ └── main.go
│ ├── 36_sessions_cookie/
│ │ └── main.go
│ ├── 37_sessions_cookie_log-in-out/
│ │ └── main.go
│ ├── 38_HMAC/
│ │ ├── 01/
│ │ │ └── main.go
│ │ ├── 02/
│ │ │ └── main.go
│ │ └── 03/
│ │ └── main.go
│ ├── 39_AES-encrypt-decrypt/
│ │ └── main.go
│ ├── 40_sessions_GORILLA/
│ │ └── main.go
│ ├── 41_sessions_GORILLA_log-in-out/
│ │ └── main.go
│ ├── 42_JSON/
│ │ └── main.go
│ ├── 43_sessions_GORILLA_JSON/
│ │ └── main.go
│ ├── 44_file-paths/
│ │ └── main.go
│ ├── 45_sessions_GORILLA_photo-blog/
│ │ ├── assets/
│ │ │ └── templates/
│ │ │ ├── index.html
│ │ │ └── login.html
│ │ └── main.go
│ └── 46_HTTPS-TLS/
│ └── main.go
├── LICENSE.txt
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof
# WebStorm
*.iml
# Directory-based project format:
.idea/
.idea/workspace.xml
**/.idea/workspace.xml
# mac hidden files
.DS_Store
#other
node_modules/
bower_components/
.tmp
.sass-cache
builds/**/images/*
*.ogg
*.mp3
*.mp4
*.png
*.jpeg
# security / ssl
*.pem
*.xxjson
================================================
FILE: 01_getting-started/01_helloWorld/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println("Hello world!")
}
================================================
FILE: 01_getting-started/02_numeral-systems/01_decimal/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(42)
}
================================================
FILE: 01_getting-started/02_numeral-systems/02_binary/main.go
================================================
package main
import "fmt"
func main() {
fmt.Printf("%d - %b \n", 42, 42)
}
================================================
FILE: 01_getting-started/02_numeral-systems/03_hexadecimal/main.go
================================================
package main
import "fmt"
func main() {
// fmt.Printf("%d - %b - %x \n", 42, 42, 42)
// fmt.Printf("%d - %b - %#x \n", 42, 42, 42)
// fmt.Printf("%d - %b - %#X \n", 42, 42, 42)
fmt.Printf("%d \t %b \t %#X \n", 42, 42, 42)
}
================================================
FILE: 01_getting-started/02_numeral-systems/04_loop/main.go
================================================
package main
import "fmt"
func main() {
for i := 1000000; i < 1000100; i++ {
fmt.Printf("%d \t %b \t %x \n", i, i, i)
}
}
================================================
FILE: 01_getting-started/03_UTF-8/main.go
================================================
package main
import "fmt"
func main() {
for i := 60; i < 122; i++ {
fmt.Printf("%d \t %b \t %x \t %q \n", i, i, i, i)
}
}
================================================
FILE: 02_package/icomefromalaska/name2.go
================================================
package winniepooh
// MyName will be exported because it starts with a capital letter.
var BearName = "Pooh"
================================================
FILE: 02_package/main/main.go
================================================
package main
import (
"fmt"
"github.com/GoesToEleven/GolangTraining/02_package/stringutil"
"github.com/GoesToEleven/GolangTraining/02_package/icomefromalaska"
//someAlias "github.com/GoesToEleven/GolangTraining/02_package/icomefromalaska"
)
func main() {
fmt.Println(stringutil.Reverse("!oG ,olleH"))
fmt.Println(stringutil.MyName)
fmt.Println(winniepooh.BearName)
}
================================================
FILE: 02_package/stringutil/name.go
================================================
package stringutil
// MyName will be exported because it starts with a capital letter.
var MyName = "Todd"
================================================
FILE: 02_package/stringutil/reverse.go
================================================
// Package stringutil contains utility functions for working with strings.
package stringutil
// Reverse returns its argument string reversed rune-wise left to right.
func Reverse(s string) string {
return reverseTwo(s)
}
/*
go build
go build reverse.go reverseTwo.go
won't produce an output file.
go install
will place the package inside the pkg directory of the workspace.
*/
================================================
FILE: 02_package/stringutil/reverseTwo.go
================================================
package stringutil
func reverseTwo(s string) string {
r := []rune(s)
for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
r[i], r[j] = r[j], r[i]
}
return string(r)
}
// this demonstrates how an unexported function
// can be used by an exported function in the same package
================================================
FILE: 03_variables/01_shorthand/01/main.go
================================================
package main
import "fmt"
func main() {
a := 10
b := "golang"
c := 4.17
d := true
e := "Hello"
f := `Do you like my hat?`
g := 'M'
fmt.Printf("%v \n", a)
fmt.Printf("%v \n", b)
fmt.Printf("%v \n", c)
fmt.Printf("%v \n", d)
fmt.Printf("%v \n", e)
fmt.Printf("%v \n", f)
fmt.Printf("%v \n", g)
}
================================================
FILE: 03_variables/01_shorthand/02/main.go
================================================
package main
import "fmt"
func main() {
a := 10
b := "golang"
c := 4.17
d := true
e := "Hello"
f := `Do you like my hat?`
g := 'M'
fmt.Printf("%T \n", a)
fmt.Printf("%T \n", b)
fmt.Printf("%T \n", c)
fmt.Printf("%T \n", d)
fmt.Printf("%T \n", e)
fmt.Printf("%T \n", f)
fmt.Printf("%T \n", g)
}
================================================
FILE: 03_variables/02_var_zero-value/main.go
================================================
package main
import "fmt"
func main() {
var a int
var b string
var c float64
var d bool
fmt.Printf("%v \n", a)
fmt.Printf("%v \n", b)
fmt.Printf("%v \n", c)
fmt.Printf("%v \n", d)
fmt.Println()
}
================================================
FILE: 03_variables/03_less-emphasis/01_declare-variable/var.go
================================================
package main
import "fmt"
func main() {
var message string
message = "Hello World."
fmt.Println(message)
}
================================================
FILE: 03_variables/03_less-emphasis/02_declare-many-at-once/var.go
================================================
package main
import "fmt"
func main() {
var message string
var a, b, c int
a = 1
message = "Hello World!"
fmt.Println(message, a, b, c)
}
================================================
FILE: 03_variables/03_less-emphasis/03_init-many-at-once/var.go
================================================
package main
import "fmt"
func main() {
var message = "Hello World!"
var a, b, c int = 1, 2, 3
fmt.Println(message, a, b, c)
}
================================================
FILE: 03_variables/03_less-emphasis/04_infer-type/var.go
================================================
package main
import "fmt"
func main() {
var message = "Hello World!"
var a, b, c = 1, 2, 3
fmt.Println(message, a, b, c)
}
================================================
FILE: 03_variables/03_less-emphasis/05_infer-mixed-up-types/var.go
================================================
package main
import "fmt"
func main() {
var message = "Hello World!"
var a, b, c = 1, false, 3
fmt.Println(message, a, b, c)
}
================================================
FILE: 03_variables/03_less-emphasis/06_init-shorthand/var.go
================================================
package main
import "fmt"
func main() {
// you can only do this inside a func
message := "Hello World!"
a, b, c := 1, false, 3
d := 4
e := true
fmt.Println(message, a, b, c, d, e)
}
================================================
FILE: 03_variables/03_less-emphasis/07_all-together/variables.go
================================================
package main
import "fmt"
var a = "this is stored in the variable a" // package scope
var b, c string = "stored in b", "stored in c" // package scope
var d string // package scope
func main() {
d = "stored in d" // declaration above; assignment here; package scope
var e = 42 // function scope - subsequent variables have func scope:
f := 43
g := "stored in g"
h, i := "stored in h", "stored in i"
j, k, l, m := 44.7, true, false, 'm' // single quotes
n := "n" // double quotes
o := `o` // back ticks
fmt.Println("a - ", a)
fmt.Println("b - ", b)
fmt.Println("c - ", c)
fmt.Println("d - ", d)
fmt.Println("e - ", e)
fmt.Println("f - ", f)
fmt.Println("g - ", g)
fmt.Println("h - ", h)
fmt.Println("i - ", i)
fmt.Println("j - ", j)
fmt.Println("k - ", k)
fmt.Println("l - ", l)
fmt.Println("m - ", m)
fmt.Println("n - ", n)
fmt.Println("o - ", o)
}
================================================
FILE: 03_variables/03_less-emphasis/08_exercise_your-name/01_oneSolution/myNameVar.go
================================================
package main
import "fmt"
var name = "Todd"
func main() {
fmt.Println("Hello ", name)
}
================================================
FILE: 03_variables/03_less-emphasis/08_exercise_your-name/02_anotherSolution/myNameVar.go
================================================
package main
import "fmt"
func main() {
var name = "Todd"
fmt.Println("Hello ", name)
}
================================================
FILE: 03_variables/03_less-emphasis/08_exercise_your-name/03_anotherSolution/myNameVar.go
================================================
package main
import "fmt"
func main() {
name := "Todd"
fmt.Println("Hello ", name)
}
================================================
FILE: 03_variables/03_less-emphasis/08_exercise_your-name/04_anotherSolution/myNameVar.go
================================================
package main
import "fmt"
func main() {
name := `Todd` // back-ticks work like double-quotes
fmt.Println("Hello ", name)
}
================================================
FILE: 04_scope/01_package-scope/01/main.go
================================================
package main
import "fmt"
var x = 42
func main() {
fmt.Println(x)
foo()
}
func foo() {
fmt.Println(x)
}
================================================
FILE: 04_scope/01_package-scope/02_visibility/main/main.go
================================================
package main
import (
"fmt"
"github.com/GoesToEleven/GolangTraining/04_scope/01_package-scope/02_visibility/vis"
)
func main() {
fmt.Println(vis.MyName)
vis.PrintVar()
}
================================================
FILE: 04_scope/01_package-scope/02_visibility/vis/name.go
================================================
package vis
// MyName is exported because it starts with a capital letter
var MyName = "Todd"
var yourName = "Future Rock Star Programmer"
================================================
FILE: 04_scope/01_package-scope/02_visibility/vis/printer.go
================================================
package vis
import "fmt"
// PrintVar is exported because it starts with a capital letter
func PrintVar() {
fmt.Println(MyName)
fmt.Println(yourName)
}
================================================
FILE: 04_scope/02_block-scope/01_this-does-not-compile/main.go
================================================
package main
import "fmt"
func main() {
x := 42
fmt.Println(x)
foo()
}
func foo() {
// no access to x
// this does not compile
fmt.Println(x)
}
================================================
FILE: 04_scope/02_block-scope/02_closure/01/main.go
================================================
package main
import "fmt"
func main() {
x := 42
fmt.Println(x)
{
fmt.Println(x)
y := "The credit belongs with the one who is in the ring."
fmt.Println(y)
}
// fmt.Println(y) // outside scope of y
}
================================================
FILE: 04_scope/02_block-scope/02_closure/02/main.go
================================================
package main
import "fmt"
var x = 0
func increment() int {
x++
return x
}
func main() {
fmt.Println(increment())
fmt.Println(increment())
}
/*
closure helps us limit the scope of variables used by multiple functions
without closure, for two or more funcs to have access to the same variable,
that variable would need to be package scope
*/
================================================
FILE: 04_scope/02_block-scope/02_closure/03/main.go
================================================
package main
import "fmt"
func main() {
x := 0
increment := func() int {
x++
return x
}
fmt.Println(increment())
fmt.Println(increment())
}
/*
closure helps us limit the scope of variables used by multiple functions
without closure, for two or more funcs to have access to the same variable,
that variable would need to be package scope
anonymous function
a function without a name
func expression
assigning a func to a variable
*/
================================================
FILE: 04_scope/02_block-scope/02_closure/04/main.go
================================================
package main
import "fmt"
func wrapper() func() int {
x := 0
return func() int {
x++
return x
}
}
func main() {
increment := wrapper()
fmt.Println(increment())
fmt.Println(increment())
}
/*
closure helps us limit the scope of variables used by multiple functions
without closure, for two or more funcs to have access to the same variable,
that variable would need to be package scope
*/
================================================
FILE: 04_scope/03_order-matters/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(x)
fmt.Println(y)
x := 42
}
var y = 42
================================================
FILE: 04_scope/04_variable-shadowing/main.go
================================================
package main
import "fmt"
func max(x int) int {
return 42 + x
}
func main() {
max := max(7)
fmt.Println(max) // max is now the result, not the function
}
// don't do this; bad coding practice to shadow variables
================================================
FILE: 04_scope/05_same-package/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(x)
}
// IMPORTANT
// to run this code:
// go run *.go
// ---- OR ----
// go build
//./05_same-package
================================================
FILE: 04_scope/05_same-package/same.go
================================================
package main
var x = 7
================================================
FILE: 05_blank-identifier/01_invalid-code/main.go
================================================
package main
import "fmt"
func main() {
a := "stored in a"
b := "stored in b"
fmt.Println("a - ", a)
// b is not being used - invalid code
}
================================================
FILE: 05_blank-identifier/02_http-get_example/01_with-error-checking/main.go
================================================
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
res, err := http.Get("http://www.geekwiseacademy.com/")
if err != nil {
log.Fatal(err)
}
page, err := ioutil.ReadAll(res.Body)
res.Body.Close()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s", page)
}
================================================
FILE: 05_blank-identifier/02_http-get_example/02_no-error-checking/main.go
================================================
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
res, _ := http.Get("http://www.geekwiseacademy.com/")
page, _ := ioutil.ReadAll(res.Body)
res.Body.Close()
fmt.Printf("%s", page)
}
================================================
FILE: 06_constants/01_constant/main.go
================================================
package main
import "fmt"
const p = "death & taxes"
func main() {
const q = 42
fmt.Println("p - ", p)
fmt.Println("q - ", q)
}
// a CONSTANT is a simple unchanging value
================================================
FILE: 06_constants/02_multiple-initialization/main.go
================================================
package main
import "fmt"
const (
pi = 3.14
language = "Go"
)
func main() {
fmt.Println(pi)
fmt.Println(language)
}
================================================
FILE: 06_constants/03_iota/main.go
================================================
package main
import "fmt"
const (
a = iota // 0
b = iota // 1
c = iota // 2
)
func main() {
fmt.Println(a)
fmt.Println(b)
fmt.Println(c)
}
================================================
FILE: 06_constants/04_iota/main.go
================================================
package main
import "fmt"
const (
a = iota // 0
b // 1
c // 2
)
func main() {
fmt.Println(a)
fmt.Println(b)
fmt.Println(c)
}
================================================
FILE: 06_constants/05_iota/main.go
================================================
package main
import "fmt"
const (
a = iota // 0
b // 1
c // 2
)
const (
d = iota // 0
e // 1
f // 2
)
func main() {
fmt.Println(a)
fmt.Println(b)
fmt.Println(c)
fmt.Println(d)
fmt.Println(e)
fmt.Println(f)
}
================================================
FILE: 06_constants/06_iota/main.go
================================================
package main
import "fmt"
const (
_ = iota // 0
b = iota * 10 // 1 * 10
c = iota * 10 // 2 * 10
)
func main() {
fmt.Println(b)
fmt.Println(c)
}
================================================
FILE: 06_constants/07_iota/main.go
================================================
package main
import "fmt"
const (
_ = iota // 0
KB = 1 << (iota * 10) // 1 << (1 * 10)
MB = 1 << (iota * 10) // 1 << (2 * 10)
GB = 1 << (iota * 10) // 1 << (3 * 10)
TB = 1 << (iota * 10) // 1 << (4 * 10)
)
func main() {
fmt.Println("binary\t\tdecimal")
fmt.Printf("%b\t", KB)
fmt.Printf("%d\n", KB)
fmt.Printf("%b\t", MB)
fmt.Printf("%d\n", MB)
fmt.Printf("%b\t", GB)
fmt.Printf("%d\n", GB)
fmt.Printf("%b\t", TB)
fmt.Printf("%d\n", TB)
}
================================================
FILE: 07_memory-address/01_showing-address/main.go
================================================
package main
import "fmt"
func main() {
a := 43
fmt.Println("a - ", a)
fmt.Println("a's memory address - ", &a)
fmt.Printf("%d \n", &a)
}
================================================
FILE: 07_memory-address/02_using-address/main.go
================================================
package main
import "fmt"
const metersToYards float64 = 1.09361
func main() {
var meters float64
fmt.Print("Enter meters swam: ")
fmt.Scan(&meters)
yards := meters * metersToYards
fmt.Println(meters, " meters is ", yards, " yards.")
}
================================================
FILE: 08_pointers/01_referencing/main.go
================================================
package main
import (
"fmt"
)
func main() {
a := 43
fmt.Println(a)
fmt.Println(&a)
var b = &a
fmt.Println(b)
// the above code makes b a pointer to the memory address where an int is stored
// b is of type "int pointer"
// *int -- the * is part of the type -- b is of type *int
}
================================================
FILE: 08_pointers/02_dereferencing/main.go
================================================
package main
import "fmt"
func main() {
a := 43
fmt.Println(a) // 43
fmt.Println(&a) // 0x20818a220
var b = &a
fmt.Println(b) // 0x20818a220
fmt.Println(*b) // 43
// b is an int pointer;
// b points to the memory address where an int is stored
// to see the value in that memory address, add a * in front of b
// this is known as dereferencing
// the * is an operator in this case
}
================================================
FILE: 08_pointers/03_using-pointers/main.go
================================================
package main
import "fmt"
func main() {
a := 43
fmt.Println(a) // 43
fmt.Println(&a) // 0x20818a220
var b = &a
fmt.Println(b) // 0x20818a220
fmt.Println(*b) // 43
*b = 42 // b says, "The value at this address, change it to 42"
fmt.Println(a) // 42
// this is useful
// we can pass a memory address instead of a bunch of values (we can pass a reference)
// and then we can still change the value of whatever is stored at that memory address
// this makes our programs more performant
// we don't have to pass around large amounts of data
// we only have to pass around addresses
// everything is PASS BY VALUE in go, btw
// when we pass a memory address, we are passing a value
}
================================================
FILE: 08_pointers/04_using-pointers/01_no-pointer/01/main.go
================================================
package main
import "fmt"
func zero(z int) {
z = 0
}
func main() {
x := 5
zero(x)
fmt.Println(x) // x is still 5
}
================================================
FILE: 08_pointers/04_using-pointers/01_no-pointer/02_see-the-addresses/main.go
================================================
package main
import "fmt"
func zero(z int) {
fmt.Printf("%p\n", &z) // address in func zero
fmt.Println(&z) // address in func zero
z = 0
}
func main() {
x := 5
fmt.Printf("%p\n", &x) // address in main
fmt.Println(&x) // address in main
zero(x)
fmt.Println(x) // x is still 5
}
================================================
FILE: 08_pointers/04_using-pointers/02_pointer/01/main.go
================================================
package main
import "fmt"
func zero(z *int) {
*z = 0
}
func main() {
x := 5
zero(&x)
fmt.Println(x) // x is 0
}
================================================
FILE: 08_pointers/04_using-pointers/02_pointer/02_see-the-addresses/main.go
================================================
package main
import "fmt"
func zero(z *int) {
fmt.Println(z)
*z = 0
}
func main() {
x := 5
fmt.Println(&x)
zero(&x)
fmt.Println(x) // x is 0
}
================================================
FILE: 09_remainder/main.go
================================================
package main
import "fmt"
func main() {
x := 13 % 3
fmt.Println(x)
if x == 1 {
fmt.Println("Odd")
} else {
fmt.Println("Even")
}
for i := 1; i < 70; i++ {
if i%2 == 1 {
fmt.Println("Odd")
} else {
fmt.Println("Even")
}
}
}
================================================
FILE: 10_for-loop/01_init-condition-post/main.go
================================================
package main
import "fmt"
func main() {
for i := 0; i <= 100; i++ {
fmt.Println(i)
}
}
================================================
FILE: 10_for-loop/02_nested/main.go
================================================
package main
import "fmt"
func main() {
for i := 0; i < 5; i++ {
for j := 0; j < 5; j++ {
fmt.Println(i, " - ", j)
}
}
}
================================================
FILE: 10_for-loop/03_for-condition-while-ish/main.go
================================================
package main
import "fmt"
func main() {
i := 0
for i < 10 {
fmt.Println(i)
i++
}
}
================================================
FILE: 10_for-loop/04_for_no-condition/main.go
================================================
package main
import "fmt"
func main() {
i := 0
for {
fmt.Println(i)
i++
}
}
================================================
FILE: 10_for-loop/05_for_break/main.go
================================================
package main
import "fmt"
func main() {
i := 0
for {
fmt.Println(i)
if i >= 10 {
break
}
i++
}
}
================================================
FILE: 10_for-loop/06_for_continue/main.go
================================================
package main
import "fmt"
func main() {
i := 0
for {
i++
if i%2 == 0 {
continue
}
fmt.Println(i)
if i >= 50 {
break
}
}
}
================================================
FILE: 10_for-loop/07_rune-loop_UTF8/01/main.go
================================================
package main
import "fmt"
func main() {
for i := 250; i <= 340; i++ {
fmt.Println(i, " - ", string(i), " - ", []byte(string(i)))
}
foo := "a"
fmt.Println(foo)
fmt.Printf("%T \n", foo)
}
/*
NOTE:
Some operating systems (Windows) might not print characters where i < 256
If you have this issue, you can use this code:
fmt.Println(i, " - ", string(i), " - ", []int32(string(i)))
UTF-8 is the text coding scheme used by Go.
UTF-8 works with 1 - 4 bytes.
A byte is 8 bits.
[]byte deals with bytes, that is, only 1 byte (8 bits) at a time.
[]int32 allows us to store the value of 4 bytes, that is, 4 bytes * 8 bits per byte = 32 bits.
*/
================================================
FILE: 10_for-loop/07_rune-loop_UTF8/02/main.go
================================================
package main
import "fmt"
func main() {
for i := 50; i <= 140; i++ {
fmt.Printf("%v - %v - %v \n", i, string(i), []byte(string(i)))
}
}
================================================
FILE: 11_switch-statements/01_switch/main.go
================================================
package main
import "fmt"
func main() {
switch "Mhi" {
case "Daniel":
fmt.Println("Wassup Daniel")
case "Medhi":
fmt.Println("Wassup Medhi")
case "Jenny":
fmt.Println("Wassup Jenny")
default:
fmt.Println("Have you no friends?")
}
}
/*
no default fallthrough
fallthrough is optional
-- you can specify fallthrough by explicitly stating it
-- break isn't needed like in other languages
*/
================================================
FILE: 11_switch-statements/02_fallthrough/main.go
================================================
package main
import "fmt"
func main() {
switch "Marcus" {
case "Tim":
fmt.Println("Wassup Tim")
case "Jenny":
fmt.Println("Wassup Jenny")
case "Marcus":
fmt.Println("Wassup Marcus")
fallthrough
case "Medhi":
fmt.Println("Wassup Medhi")
fallthrough
case "Julian":
fmt.Println("Wassup Julian")
case "Sushant":
fmt.Println("Wassup Sushant")
}
}
================================================
FILE: 11_switch-statements/03_multiple-evals/main.go
================================================
package main
import "fmt"
func main() {
switch "Jenny" {
case "Tim", "Jenny":
fmt.Println("Wassup Tim, or, err, Jenny")
case "Marcus", "Medhi":
fmt.Println("Both of your names start with M")
case "Julian", "Sushant":
fmt.Println("Wassup Julian / Sushant")
}
}
================================================
FILE: 11_switch-statements/04_no-expression/main.go
================================================
package main
import "fmt"
func main() {
myFriendsName := "Mar"
switch {
case len(myFriendsName) == 2:
fmt.Println("Wassup my friend with name of length 2")
case myFriendsName == "Tim":
fmt.Println("Wassup Tim")
case myFriendsName == "Jenny":
fmt.Println("Wassup Jenny")
case myFriendsName == "Marcus", myFriendsName == "Medhi":
fmt.Println("Your name is either Marcus or Medhi")
case myFriendsName == "Julian":
fmt.Println("Wassup Julian")
case myFriendsName == "Sushant":
fmt.Println("Wassup Sushant")
default:
fmt.Println("nothing matched; this is the default")
}
}
/*
expression not needed
-- if no expression provided, go checks for the first case that evals to true
-- makes the switch operate like if/if else/else
cases can be expressions
*/
================================================
FILE: 11_switch-statements/05_on-type/type.go
================================================
package main
import "fmt"
// switch on types
// -- normally we switch on value of variable
// -- go allows you to switch on type of variable
type contact struct {
greeting string
name string
}
// SwitchOnType works with interfaces
// we'll learn more about interfaces later
func SwitchOnType(x interface{}) {
switch x.(type) { // this is an assert; asserting, "x is of this type"
case int:
fmt.Println("int")
case string:
fmt.Println("string")
case contact:
fmt.Println("contact")
default:
fmt.Println("unknown")
}
}
func main() {
SwitchOnType(7)
SwitchOnType("McLeod")
var t = contact{"Good to see you,", "Tim"}
SwitchOnType(t)
SwitchOnType(t.greeting)
SwitchOnType(t.name)
}
================================================
FILE: 12_if_else-if_else/01_eval-true/main.go
================================================
package main
import "fmt"
func main() {
if true {
fmt.Println("This ran")
}
if false {
fmt.Println("This did not run")
}
}
================================================
FILE: 12_if_else-if_else/02_not-exclamation/main.go
================================================
package main
import "fmt"
func main() {
if !true {
fmt.Println("This did not run")
}
if !false {
fmt.Println("This ran")
}
}
================================================
FILE: 12_if_else-if_else/03_init-statement/main.go
================================================
package main
import "fmt"
func main() {
b := true
if food := "Chocolate"; b {
fmt.Println(food)
}
}
================================================
FILE: 12_if_else-if_else/04_init-statement_error_invalid-code/main.go
================================================
package main
import "fmt"
func main() {
b := true
if food := "Chocolate"; b {
fmt.Println(food)
}
fmt.Println(food)
}
================================================
FILE: 12_if_else-if_else/05_if-else/main.go
================================================
package main
import "fmt"
func main() {
if false {
fmt.Println("first print statement")
} else {
fmt.Println("second print statement")
}
}
================================================
FILE: 12_if_else-if_else/06_if-elseif-else/main.go
================================================
package main
import "fmt"
func main() {
if false {
fmt.Println("first print statement")
} else if true {
fmt.Println("second print statement")
} else {
fmt.Println("third print statement")
}
}
================================================
FILE: 12_if_else-if_else/07_if-elseif-elseif-else/main.go
================================================
package main
import "fmt"
func main() {
if false {
fmt.Println("first print statement")
} else if false {
fmt.Println("second print statement")
} else if true {
fmt.Println("ahahaha print statement")
} else {
fmt.Println("third print statement")
}
}
================================================
FILE: 12_if_else-if_else/08_divisibleByThree/main.go
================================================
package main
import "fmt"
func main() {
for i := 0; i <= 100; i++ {
if i%3 == 0 {
fmt.Println(i)
}
}
}
================================================
FILE: 13_exercise-solutions/01_hello-world/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println("Hello World")
}
================================================
FILE: 13_exercise-solutions/02_hello-NAME/main.go
================================================
package main
import "fmt"
func main() {
name := "Todd"
fmt.Println("Hello", name)
}
================================================
FILE: 13_exercise-solutions/03_hello-user-input/main.go
================================================
package main
import "fmt"
func main() {
var name string
fmt.Print("Please enter your name: ")
fmt.Scan(&name)
fmt.Println("Hello", name)
}
================================================
FILE: 13_exercise-solutions/04_user-enters-numbers/main.go
================================================
package main
import "fmt"
func main() {
var numOne int
var numTwo int
fmt.Print("Please enter a large number: ")
fmt.Scan(&numOne)
fmt.Print("Please enter a smaller number: ")
fmt.Scan(&numTwo)
fmt.Println(numOne, "%", numTwo, " = ", numOne%numTwo)
}
================================================
FILE: 13_exercise-solutions/05_even-numbers/main.go
================================================
package main
import "fmt"
func main() {
for i := 0; i <= 100; i++ {
if i%2 == 0 {
fmt.Println(i)
}
}
}
================================================
FILE: 13_exercise-solutions/06_fizzBuzz/main.go
================================================
package main
import "fmt"
func main() {
for i := 0; i <= 100; i++ {
if i%15 == 0 {
fmt.Println(i, " -- FizzBuzz")
} else if i%3 == 0 {
fmt.Println(i, " -- FIZZ")
} else if i%5 == 0 {
fmt.Println(i, " -- BUZZ")
} else {
fmt.Println(i)
}
}
}
================================================
FILE: 13_exercise-solutions/07_threeFive/main.go
================================================
package main
import "fmt"
func main() {
counter := 0
for i := 0; i < 1000; i++ {
if i%3 == 0 {
counter += i
} else if i%5 == 0 {
counter += i
}
}
fmt.Println(counter)
}
/*
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9.
The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
*/
================================================
FILE: 13_exercise-solutions/08_just-fyi/01_benchMark/bm_test.go
================================================
package main
import (
"fmt"
"testing"
)
func BenchmarkHello(b *testing.B) {
for i := 0; i < b.N; i++ {
fmt.Sprintf("hello")
}
}
// run this at command:
// go test -bench='.*'
================================================
FILE: 13_exercise-solutions/08_just-fyi/02_benchMark/bm_test.go
================================================
package main
import (
"fmt"
"testing"
)
func BenchmarkHello(b *testing.B) {
counter := 0
for i := 0; i < b.N; i++ {
if i%3 == 0 {
counter += i
} else if i%5 == 0 {
counter += i
}
}
fmt.Println(counter)
}
// run this at command:
// go test -bench='.*'
================================================
FILE: 13_exercise-solutions/08_just-fyi/03_utf/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println("Hello"[1])
}
================================================
FILE: 14_functions/01_main/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println("Hello world!")
}
// main is the entry point to your program
================================================
FILE: 14_functions/02_param-arg/main.go
================================================
package main
import "fmt"
func main() {
greet("Jane")
greet("John")
}
func greet(name string) {
fmt.Println(name)
}
// greet is declared with a parameter
// when calling greet, pass in an argument
================================================
FILE: 14_functions/03_two-params/01/main.go
================================================
package main
import "fmt"
func main() {
greet("Jane", "Doe")
}
func greet(fname string, lname string) {
fmt.Println(fname, lname)
}
================================================
FILE: 14_functions/03_two-params/02/main.go
================================================
package main
import "fmt"
func main() {
greet("Jane", "Doe")
}
func greet(fname, lname string) {
fmt.Println(fname, lname)
}
================================================
FILE: 14_functions/04_return/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(greet("Jane ", "Doe"))
}
func greet(fname, lname string) string {
return fmt.Sprint(fname, lname)
}
================================================
FILE: 14_functions/05_return-naming/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(greet("Jane ", "Doe"))
}
func greet(fname string, lname string) (s string) {
s = fmt.Sprint(fname, lname)
return
}
/*
IMPORTANT
Avoid using named returns.
Occasionally named returns are useful. Read this article for more information:
https://www.goinggo.net/2013/10/functions-and-naked-returns-in-go.html
*/
================================================
FILE: 14_functions/06_return-multiple/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(greet("Jane ", "Doe "))
}
func greet(fname, lname string) (string, string) {
return fmt.Sprint(fname, lname), fmt.Sprint(lname, fname)
}
================================================
FILE: 14_functions/07_variadic-params/main.go
================================================
package main
import "fmt"
func main() {
n := average(43, 56, 87, 12, 45, 57)
fmt.Println(n)
}
func average(sf ...float64) float64 {
fmt.Println(sf)
fmt.Printf("%T \n", sf)
var total float64
for _, v := range sf {
total += v
}
return total / float64(len(sf))
}
================================================
FILE: 14_functions/08_variadic-args/main.go
================================================
package main
import "fmt"
func main() {
data := []float64{43, 56, 87, 12, 45, 57}
n := average(data...)
fmt.Println(n)
}
func average(sf ...float64) float64 {
total := 0.0
for _, v := range sf {
total += v
}
return total / float64(len(sf))
}
================================================
FILE: 14_functions/09_slice-param-arg/main.go
================================================
package main
import "fmt"
func main() {
data := []float64{43, 56, 87, 12, 45, 57}
n := average(data)
fmt.Println(n)
}
func average(sf []float64) float64 {
total := 0.0
for _, v := range sf {
total += v
}
return total / float64(len(sf))
}
================================================
FILE: 14_functions/10_func-expression/01_before-func-expression/main.go
================================================
package main
import "fmt"
func greeting() {
fmt.Println("Hello world!")
}
func main() {
greeting()
}
================================================
FILE: 14_functions/10_func-expression/02_func-expression/main.go
================================================
package main
import "fmt"
func main() {
greeting := func() {
fmt.Println("Hello world!")
}
greeting()
}
================================================
FILE: 14_functions/10_func-expression/03_func-expression_shows-type/main.go
================================================
package main
import "fmt"
func main() {
greeting := func() {
fmt.Println("Hello world!")
}
greeting()
fmt.Printf("%T\n", greeting)
}
================================================
FILE: 14_functions/10_func-expression/04_another-way_func-expression/main.go
================================================
package main
import "fmt"
func makeGreeter() func() string {
return func() string {
return "Hello world!"
}
}
func main() {
greet := makeGreeter()
fmt.Println(greet())
}
================================================
FILE: 14_functions/10_func-expression/05_another-way_func-expression_shows-type/main.go
================================================
package main
import "fmt"
func makeGreeter() func() string {
return func() string {
return "Hello world!"
}
}
func main() {
greet := makeGreeter()
fmt.Println(greet())
fmt.Printf("%T\n", greet)
}
================================================
FILE: 14_functions/11_closure/01/main.go
================================================
package main
import "fmt"
func main() {
x := 42
fmt.Println(x)
{
fmt.Println(x)
y := "The credit belongs with the one who is in the ring."
fmt.Println(y)
}
// fmt.Println(y) // outside scope of y
}
================================================
FILE: 14_functions/11_closure/02/main.go
================================================
package main
import "fmt"
var x int
func increment() int {
x++
return x
}
func main() {
fmt.Println(increment())
fmt.Println(increment())
}
/*
closure helps us limit the scope of variables used by multiple functions
without closure, for two or more funcs to have access to the same variable,
that variable would need to be package scope
*/
================================================
FILE: 14_functions/11_closure/03/main.go
================================================
package main
import "fmt"
func main() {
x := 0
increment := func() int {
x++
return x
}
fmt.Println(increment())
fmt.Println(increment())
}
/*
closure helps us limit the scope of variables used by multiple functions
without closure, for two or more funcs to have access to the same variable,
that variable would need to be package scope
anonymous function
a function without a name
func expression
assigning a func to a variable
*/
================================================
FILE: 14_functions/11_closure/04/main.go
================================================
package main
import "fmt"
func wrapper() func() int {
var x int
return func() int {
x++
return x
}
}
func main() {
increment := wrapper()
fmt.Println(increment())
fmt.Println(increment())
}
/*
closure helps us limit the scope of variables used by multiple functions
without closure, for two or more funcs to have access to the same variable,
that variable would need to be package scope
*/
================================================
FILE: 14_functions/11_closure/05/main.go
================================================
package main
import "fmt"
func wrapper() func() int {
var x int
return func() int {
x++
return x
}
}
func main() {
incrementA := wrapper()
incrementB := wrapper()
fmt.Println("A:", incrementA())
fmt.Println("A:", incrementA())
fmt.Println("B:", incrementB())
fmt.Println("B:", incrementB())
fmt.Println("B:", incrementB())
}
/*
closure helps us limit the scope of variables used by multiple functions
without closure, for two or more funcs to have access to the same variable,
that variable would need to be package scope
*/
================================================
FILE: 14_functions/12_callbacks/01_print-nums/main.go
================================================
package main
import "fmt"
func visit(numbers []int, callback func(int)) {
for _, n := range numbers {
callback(n)
}
}
func main() {
visit([]int{1, 2, 3, 4}, func(n int) {
fmt.Println(n)
})
}
// callback: passing a func as an argument
================================================
FILE: 14_functions/12_callbacks/02_filter-nums/main.go
================================================
package main
import "fmt"
func filter(numbers []int, callback func(int) bool) []int {
var xs []int
for _, n := range numbers {
if callback(n) {
xs = append(xs, n)
}
}
return xs
}
func main() {
xs := filter([]int{1, 2, 3, 4}, func(n int) bool {
return n > 1
})
fmt.Println(xs) // [2 3 4]
}
================================================
FILE: 14_functions/13_recursion/main.go
================================================
package main
import "fmt"
func factorial(x int) int {
if x == 0 {
return 1
}
return x * factorial(x-1)
}
func main() {
fmt.Println(factorial(4))
}
================================================
FILE: 14_functions/14_defer/01_no-defer/main.go
================================================
package main
import "fmt"
func hello() {
fmt.Print("hello ")
}
func world() {
fmt.Println("world")
}
func main() {
world()
hello()
}
================================================
FILE: 14_functions/14_defer/02_with-defer/main.go
================================================
package main
import "fmt"
func hello() {
fmt.Print("hello ")
}
func world() {
fmt.Println("world")
}
func main() {
defer world()
hello()
}
================================================
FILE: 14_functions/15_passing-by-value/01_int/main.go
================================================
package main
import "fmt"
func main() {
age := 44
changeMe(age)
fmt.Println(age) // 44
}
func changeMe(z int) {
fmt.Println(z)
z = 24
}
// when changeMe is called on line 8
// the value 44 is being passed as an argument
================================================
FILE: 14_functions/15_passing-by-value/02_int-pointer/main.go
================================================
package main
import "fmt"
func main() {
age := 44
fmt.Println(&age) // 0x82023c080
changeMe(&age)
fmt.Println(&age) //0x82023c080
fmt.Println(age) //24
}
func changeMe(z *int) {
fmt.Println(z) // 0x82023c080
fmt.Println(*z) // 44
*z = 24
fmt.Println(z) // 0x82023c080
fmt.Println(*z) // 24
}
================================================
FILE: 14_functions/15_passing-by-value/03_string/main.go
================================================
package main
import "fmt"
func main() {
name := "Todd"
fmt.Println(name) // Todd
changeMe(name)
fmt.Println(name) // Todd
}
func changeMe(z string) {
fmt.Println(z) // Todd
z = "Rocky"
fmt.Println(z) // Rocky
}
================================================
FILE: 14_functions/15_passing-by-value/04_string-pointer/main.go
================================================
package main
import "fmt"
func main() {
name := "Todd"
fmt.Println(&name) // 0x82023c080
changeMe(&name)
fmt.Println(&name) //0x82023c080
fmt.Println(name) //Rocky
}
func changeMe(z *string) {
fmt.Println(z) // 0x82023c080
fmt.Println(*z) // Todd
*z = "Rocky"
fmt.Println(z) // 0x82023c080
fmt.Println(*z) // Rocky
}
================================================
FILE: 14_functions/15_passing-by-value/05_REFERENCE-TYPE/main.go
================================================
package main
import "fmt"
func main() {
m := make(map[string]int)
changeMe(m)
fmt.Println(m["Todd"]) // 44
}
func changeMe(z map[string]int) {
z["Todd"] = 44
}
/*
Allocation with make
Back to allocation. The built-in function make(T, args)
serves a purpose different from new(T). It creates slices, maps, and channels only,
and it returns an initialized (not zeroed) value of type T (not *T). The reason for
the distinction is that these three types represent, under the covers, references to data structures
that must be initialized before use. A slice, for example, is a three-item descriptor containing
a pointer to the data (inside an array), the length, and the capacity, and until those items are initialized,
the slice is nil. For slices, maps, and channels, make initializes the internal data structure and prepares
the value for use.
*/
// https://golang.org/doc/effective_go.html#allocation_make
================================================
FILE: 14_functions/15_passing-by-value/06_REFERENCE-TYPE/main.go
================================================
package main
import "fmt"
func main() {
m := make([]string, 1, 25)
fmt.Println(m) // [ ]
changeMe(m)
fmt.Println(m) // [Todd]
}
func changeMe(z []string) {
z[0] = "Todd"
fmt.Println(z) // [Todd]
}
================================================
FILE: 14_functions/15_passing-by-value/07_struct-pointer/main.go
================================================
package main
import "fmt"
type customer struct {
name string
age int
}
func main() {
c1 := customer{"Todd", 44}
fmt.Println(&c1.name) // 0x8201e4120
changeMe(&c1)
fmt.Println(c1) // {Rocky 44}
fmt.Println(&c1.name) // 0x8201e4120
}
func changeMe(z *customer) {
fmt.Println(z) // &{Todd 44}
fmt.Println(&z.name) // 0x8201e4120
z.name = "Rocky"
fmt.Println(z) // &{Rocky 44}
fmt.Println(&z.name) // 0x8201e4120
}
================================================
FILE: 14_functions/16_anon_self-executing/main.go
================================================
package main
import "fmt"
func main() {
func() {
fmt.Println("I'm driving!")
}()
}
================================================
FILE: 15_bool-expressions/01_true-false/main.go
================================================
package main
import "fmt"
func main() {
if true {
fmt.Println("This ran")
}
if false {
fmt.Println("This did not run")
}
}
================================================
FILE: 15_bool-expressions/02_not/main.go
================================================
package main
import "fmt"
func main() {
if !true {
fmt.Println("This did not run")
}
if !false {
fmt.Println("This ran")
}
}
================================================
FILE: 15_bool-expressions/03_or/main.go
================================================
package main
import "fmt"
func main() {
if true || false {
fmt.Println("This ran")
}
}
================================================
FILE: 15_bool-expressions/04_and/main.go
================================================
package main
import "fmt"
func main() {
if true && false {
fmt.Println("This did not run")
}
}
================================================
FILE: 16_exercise-solutions/01_half/01/main.go
================================================
package main
import "fmt"
func half(n int) (int, bool) {
return n / 2, n%2 == 0
}
func main() {
h, even := half(5)
fmt.Println(h, even)
}
================================================
FILE: 16_exercise-solutions/01_half/02/main.go
================================================
package main
import "fmt"
func half(n int) (float64, bool) {
return float64(n) / 2, n%2 == 0
}
func main() {
h, even := half(5)
fmt.Println(h, even)
}
================================================
FILE: 16_exercise-solutions/02_func-expression/main.go
================================================
package main
import "fmt"
func main() {
half := func(n int) (int, bool) {
return n / 2, n%2 == 0
}
fmt.Println(half(5))
}
================================================
FILE: 16_exercise-solutions/03_variadic-greatest/main.go
================================================
package main
import "fmt"
func max(numbers ...int) int {
var largest int
for _, v := range numbers {
if v > largest {
largest = v
}
}
return largest
}
func main() {
greatest := max(4, 7, 9, 123, 543, 23, 435, 53, 125)
fmt.Println(greatest)
}
/*
FYI
For your code to also work with only negative numbers such as
greatest := max(-200 -700)
include this as your range statement
for i, v := range numbers {
if v > largest || i == 0 {
largest = v
}
}
What does that code do?
The first time through the range loop
the index, i, will be zero
so largest will be set to the first number
Originally largest is set to the zero value for an int, which is zero
Zero would be greater than any negative number
if you only have negative numbers
you need largest to be something less than zero
Thanks to Ricardo G for this code improvement!
*/
================================================
FILE: 16_exercise-solutions/04_bool-expression/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println((true && false) || (false && true) || !(false && false))
}
================================================
FILE: 16_exercise-solutions/05_params-and-args/main.go
================================================
package main
import "fmt"
func main() {
foo(1, 2)
foo(1, 2, 3)
aSlice := []int{1, 2, 3, 4}
foo(aSlice...)
foo()
}
func foo(numbers ...int) {
fmt.Println(numbers)
}
================================================
FILE: 17_array/01/main.go
================================================
package main
import "fmt"
func main() {
var x [58]int
fmt.Println(x)
fmt.Println(len(x))
fmt.Println(x[42])
x[42] = 777
fmt.Println(x[42])
}
================================================
FILE: 17_array/02/main.go
================================================
package main
import "fmt"
func main() {
var x [58]string
for i := 65; i <= 122; i++ {
x[i-65] = string(i)
}
fmt.Println(x)
fmt.Println(x[42])
}
================================================
FILE: 17_array/03/main.go
================================================
package main
import "fmt"
func main() {
var x [256]int
fmt.Println(len(x))
fmt.Println(x[42])
for i := 0; i < 256; i++ {
x[i] = i
}
for i, v := range x {
fmt.Printf("%v - %T - %b\n", v, v, v)
if i > 50 {
break
}
}
}
================================================
FILE: 17_array/04/main.go
================================================
package main
import "fmt"
func main() {
var x [256]byte
fmt.Println(len(x))
fmt.Println(x[42])
for i := 0; i < 256; i++ {
x[i] = byte(i)
}
for i, v := range x {
fmt.Printf("%v - %T - %b\n", v, v, v)
if i > 50 {
break
}
}
}
================================================
FILE: 17_array/05/main.go
================================================
package main
import "fmt"
func main() {
var x [256]string
fmt.Println(len(x))
fmt.Println(x[0])
for i := 0; i < 256; i++ {
x[i] = string(i)
}
for _, v := range x {
fmt.Printf("%v - %T - %v\n", v, v, []byte(v))
}
}
================================================
FILE: 18_slice/01_int-slice/main.go
================================================
package main
import "fmt"
func main() {
mySlice := []int{1, 3, 5, 7, 9, 11}
fmt.Printf("%T\n", mySlice)
fmt.Println(mySlice)
}
================================================
FILE: 18_slice/02_int-slice/main.go
================================================
package main
import "fmt"
func main() {
xs := []int{1, 3, 5, 7, 9, 11}
for i, value := range xs {
fmt.Println(i, " - ", value)
}
}
================================================
FILE: 18_slice/03_int-slice/main.go
================================================
package main
import "fmt"
func main() {
mySlice := make([]int, 0, 3)
fmt.Println("-----------------")
fmt.Println(mySlice)
fmt.Println(len(mySlice))
fmt.Println(cap(mySlice))
fmt.Println("-----------------")
for i := 0; i < 80; i++ {
mySlice = append(mySlice, i)
fmt.Println("Len:", len(mySlice), "Capacity:", cap(mySlice), "Value: ", mySlice[i])
}
}
================================================
FILE: 18_slice/04_string-slice/main.go
================================================
package main
import "fmt"
func main() {
greeting := []string{
"Good morning!",
"Bonjour!",
"dias!",
"Bongiorno!",
"Ohayo!",
"Selamat pagi!",
"Gutten morgen!",
}
for i, currentEntry := range greeting {
fmt.Println(i, currentEntry)
}
for j := 0; j < len(greeting); j++ {
fmt.Println(greeting[j])
}
}
================================================
FILE: 18_slice/05_slicing-a-slice/01/main.go
================================================
package main
import "fmt"
func main() {
var results []int
fmt.Println(results)
mySlice := []string{"a", "b", "c", "g", "m", "z"}
fmt.Println(mySlice)
fmt.Println(mySlice[2:4]) // slicing a slice
fmt.Println(mySlice[2]) // index access; accessing by index
fmt.Println("myString"[2]) // index access; accessing by index
}
================================================
FILE: 18_slice/05_slicing-a-slice/02/main.go
================================================
package main
import "fmt"
func main() {
greeting := []string{
"Good morning!",
"Bonjour!",
"dias!",
"Bongiorno!",
"Ohayo!",
"Selamat pagi!",
"Gutten morgen!",
}
fmt.Print("[1:2] ")
fmt.Println(greeting[1:2])
fmt.Print("[:2] ")
fmt.Println(greeting[:2])
fmt.Print("[5:] ")
fmt.Println(greeting[5:])
fmt.Print("[:] ")
fmt.Println(greeting[:])
}
================================================
FILE: 18_slice/06_make/main.go
================================================
package main
import "fmt"
func main() {
customerNumber := make([]int, 3)
// 3 is length & capacity
// // length - number of elements referred to by the slice
// // capacity - number of elements in the underlying array
customerNumber[0] = 7
customerNumber[1] = 10
customerNumber[2] = 15
fmt.Println(customerNumber[0])
fmt.Println(customerNumber[1])
fmt.Println(customerNumber[2])
greeting := make([]string, 3, 5)
// 3 is length - number of elements referred to by the slice
// 5 is capacity - number of elements in the underlying array
// you could also do it like this
greeting[0] = "Good morning!"
greeting[1] = "Bonjour!"
greeting[2] = "dias!"
fmt.Println(greeting[2])
}
================================================
FILE: 18_slice/07_append-invalid/main.go
================================================
package main
import "fmt"
func main() {
greeting := make([]string, 3, 5)
// 3 is length - number of elements referred to by the slice
// 5 is capacity - number of elements in the underlying array
greeting[0] = "Good morning!"
greeting[1] = "Bonjour!"
greeting[2] = "buenos dias!"
greeting[3] = "suprabadham"
fmt.Println(greeting[2])
}
================================================
FILE: 18_slice/08_append/main.go
================================================
package main
import "fmt"
func main() {
greeting := make([]string, 3, 5)
// 3 is length - number of elements referred to by the slice
// 5 is capacity - number of elements in the underlying array
greeting[0] = "Good morning!"
greeting[1] = "Bonjour!"
greeting[2] = "buenos dias!"
greeting = append(greeting, "Suprabadham")
fmt.Println(greeting[3])
}
================================================
FILE: 18_slice/09_append-beyond-capacity/main.go
================================================
package main
import "fmt"
func main() {
greeting := make([]string, 3, 5)
// 3 is length - number of elements referred to by the slice
// 5 is capacity - number of elements in the underlying array
greeting[0] = "Good morning!"
greeting[1] = "Bonjour!"
greeting[2] = "buenos dias!"
greeting = append(greeting, "Suprabadham")
greeting = append(greeting, "Zǎo'ān")
greeting = append(greeting, "Ohayou gozaimasu")
greeting = append(greeting, "gidday")
fmt.Println(greeting[6])
fmt.Println(len(greeting))
fmt.Println(cap(greeting))
}
================================================
FILE: 18_slice/10_append_slice-to-slice/01_slice-of-ints/main.go
================================================
package main
import "fmt"
func main() {
mySlice := []int{1, 2, 3, 4, 5}
myOtherSlice := []int{6, 7, 8, 9}
mySlice = append(mySlice, myOtherSlice...)
fmt.Println(mySlice)
}
================================================
FILE: 18_slice/10_append_slice-to-slice/02_slice-of-strings/main.go
================================================
package main
import "fmt"
func main() {
mySlice := []string{"Monday", "Tuesday"}
myOtherSlice := []string{"Wednesday", "Thursday", "Friday"}
mySlice = append(mySlice, myOtherSlice...)
fmt.Println(mySlice)
}
================================================
FILE: 18_slice/11_delete/main.go
================================================
package main
import "fmt"
func main() {
mySlice := []string{"Monday", "Tuesday"}
myOtherSlice := []string{"Wednesday", "Thursday", "Friday"}
mySlice = append(mySlice, myOtherSlice...)
fmt.Println(mySlice)
mySlice = append(mySlice[:2], mySlice[3:]...)
fmt.Println(mySlice)
}
================================================
FILE: 18_slice/12_multi-dimensional/01_shorthand-slice/main.go
================================================
package main
import (
"fmt"
)
func main() {
student := []string{}
students := [][]string{}
fmt.Println(student)
fmt.Println(students)
fmt.Println(student == nil)
}
================================================
FILE: 18_slice/12_multi-dimensional/02_var-slice/main.go
================================================
package main
import (
"fmt"
)
func main() {
var student []string
var students [][]string
fmt.Println(student)
fmt.Println(students)
fmt.Println(student == nil)
}
================================================
FILE: 18_slice/12_multi-dimensional/03_make-slice/main.go
================================================
package main
import (
"fmt"
)
func main() {
student := make([]string, 35)
students := make([][]string, 35)
fmt.Println(student)
fmt.Println(students)
fmt.Println(student == nil)
}
================================================
FILE: 18_slice/12_multi-dimensional/04_comparing_shorthand_var_make/01_shorthand-slice/main.go
================================================
package main
import (
"fmt"
)
func main() {
student := []string{}
students := [][]string{}
student[0] = "Todd"
// student = append(student, "Todd")
fmt.Println(student)
fmt.Println(students)
}
================================================
FILE: 18_slice/12_multi-dimensional/04_comparing_shorthand_var_make/02_var-slice/main.go
================================================
package main
import (
"fmt"
)
func main() {
var student []string
var students [][]string
student[0] = "Todd"
// student = append(student, "Todd")
fmt.Println(student)
fmt.Println(students)
}
================================================
FILE: 18_slice/12_multi-dimensional/04_comparing_shorthand_var_make/03_make-slice/main.go
================================================
package main
import (
"fmt"
)
func main() {
student := make([]string, 35)
students := make([][]string, 35)
student[0] = "Todd"
// student = append(student, "Todd")
fmt.Println(student)
fmt.Println(students)
}
================================================
FILE: 18_slice/12_multi-dimensional/05_slice-of-slice-of-string/main.go
================================================
package main
import (
"fmt"
)
func main() {
var records [][]string
// student 1
student1 := make([]string, 4)
student1[0] = "Foster"
student1[1] = "Nathan"
student1[2] = "100.00"
student1[3] = "74.00"
// store the record
records = append(records, student1)
// student 2
student2 := make([]string, 4)
student2[0] = "Gomez"
student2[1] = "Lisa"
student2[2] = "92.00"
student2[3] = "96.00"
// store the record
records = append(records, student2)
// print
fmt.Println(records)
}
================================================
FILE: 18_slice/12_multi-dimensional/06_slice-of-slice-of-int/main.go
================================================
package main
import (
"fmt"
)
func main() {
transactions := make([][]int, 0, 3)
for i := 0; i < 3; i++ {
transaction := make([]int, 0, 4)
for j := 0; j < 4; j++ {
transaction = append(transaction, j)
}
transactions = append(transactions, transaction)
}
fmt.Println(transactions)
}
================================================
FILE: 18_slice/13_int-slice-plus-plus/main.go
================================================
package main
import "fmt"
func main() {
mySlice := make([]int, 1)
fmt.Println(mySlice[0])
mySlice[0] = 7
fmt.Println(mySlice[0])
mySlice[0]++
fmt.Println(mySlice[0])
}
================================================
FILE: 19_map/01_var_nil-map/main.go
================================================
package main
import "fmt"
func main() {
var myGreeting map[string]string
fmt.Println(myGreeting)
fmt.Println(myGreeting == nil)
}
// add these lines:
/*
myGreeting["Tim"] = "Good morning."
myGreeting["Jenny"] = "Bonjour."
*/
// and you will get this:
// panic: assignment to entry in nil map
================================================
FILE: 19_map/02_var_make/main.go
================================================
package main
import "fmt"
func main() {
var myGreeting = make(map[string]string)
myGreeting["Tim"] = "Good morning."
myGreeting["Jenny"] = "Bonjour."
fmt.Println(myGreeting)
}
================================================
FILE: 19_map/03_shorthand_make/main.go
================================================
package main
import "fmt"
func main() {
myGreeting := make(map[string]string)
myGreeting["Tim"] = "Good morning."
myGreeting["Jenny"] = "Bonjour."
fmt.Println(myGreeting)
}
================================================
FILE: 19_map/04_shorthand_composite-literal/main.go
================================================
package main
import "fmt"
func main() {
myGreeting := map[string]string{}
myGreeting["Tim"] = "Good morning."
myGreeting["Jenny"] = "Bonjour."
fmt.Println(myGreeting)
}
================================================
FILE: 19_map/05_shorthand_composite-literal/main.go
================================================
package main
import "fmt"
func main() {
myGreeting := map[string]string{
"Tim": "Good morning!",
"Jenny": "Bonjour!",
}
fmt.Println(myGreeting["Jenny"])
}
================================================
FILE: 19_map/06_adding-entry/main.go
================================================
package main
import "fmt"
func main() {
myGreeting := map[string]string{
"Tim": "Good morning!",
"Jenny": "Bonjour!",
}
myGreeting["Harleen"] = "Howdy"
fmt.Println(myGreeting)
}
================================================
FILE: 19_map/07_len/main.go
================================================
package main
import "fmt"
func main() {
myGreeting := map[string]string{
"Tim": "Good morning!",
"Jenny": "Bonjour!",
}
myGreeting["Harleen"] = "Howdy"
fmt.Println(len(myGreeting))
}
================================================
FILE: 19_map/08_updating-entry/main.go
================================================
package main
import "fmt"
func main() {
myGreeting := map[string]string{
"Tim": "Good morning!",
"Jenny": "Bonjour!",
}
myGreeting["Harleen"] = "Howdy"
fmt.Println(myGreeting)
myGreeting["Harleen"] = "Gidday"
fmt.Println(myGreeting)
}
================================================
FILE: 19_map/09_deleting-entry/main.go
================================================
package main
import "fmt"
func main() {
myGreeting := map[string]string{
"zero": "Good morning!",
"one": "Bonjour!",
"two": "Buenos dias!",
"three": "Bongiorno!",
}
fmt.Println(myGreeting)
delete(myGreeting, "two")
fmt.Println(myGreeting)
}
================================================
FILE: 19_map/10_comma-ok-idiom_val-exists/main.go
================================================
package main
import "fmt"
func main() {
myGreeting := map[int]string{
0: "Good morning!",
1: "Bonjour!",
2: "Buenos dias!",
3: "Bongiorno!",
}
fmt.Println(myGreeting)
// delete(myGreeting, 2)
if val, exists := myGreeting[2]; exists {
fmt.Println("That value exists.")
fmt.Println("val: ", val)
fmt.Println("exists: ", exists)
} else {
fmt.Println("That value doesn't exist.")
fmt.Println("val: ", val)
fmt.Println("exists: ", exists)
}
fmt.Println(myGreeting)
}
================================================
FILE: 19_map/11_deleting-entry_no-error/main.go
================================================
package main
import "fmt"
func main() {
myGreeting := map[int]string{
0: "Good morning!",
1: "Bonjour!",
2: "Buenos dias!",
3: "Bongiorno!",
}
fmt.Println(myGreeting)
delete(myGreeting, 7)
fmt.Println(myGreeting)
}
================================================
FILE: 19_map/12_comma-ok-idiom_val-not-exists/main.go
================================================
package main
import "fmt"
func main() {
myGreeting := map[int]string{
0: "Good morning!",
1: "Bonjour!",
2: "Buenos dias!",
3: "Bongiorno!",
}
fmt.Println(myGreeting)
if val, exists := myGreeting[7]; exists {
delete(myGreeting, 7)
fmt.Println("val: ", val)
fmt.Println("exists: ", exists)
} else {
fmt.Println("That value doesn't exist.")
fmt.Println("val: ", val)
fmt.Println("exists: ", exists)
}
fmt.Println(myGreeting)
}
================================================
FILE: 19_map/13_loop-range/main.go
================================================
package main
import "fmt"
func main() {
myGreeting := map[int]string{
0: "Good morning!",
1: "Bonjour!",
2: "Buenos dias!",
3: "Bongiorno!",
}
for key, val := range myGreeting {
fmt.Println(key, " - ", val)
}
}
================================================
FILE: 19_map/14_hash-table/01_letter-buckets/01_runes-are-numbers/main.go
================================================
package main
import "fmt"
func main() {
letter := 'A'
fmt.Println(letter)
fmt.Printf("%T \n", letter)
}
================================================
FILE: 19_map/14_hash-table/01_letter-buckets/02_strings-to-rune-conversion/main.go
================================================
package main
import "fmt"
func main() {
letter := rune("A"[0])
fmt.Println(letter)
}
================================================
FILE: 19_map/14_hash-table/01_letter-buckets/03_string-index-access/main.go
================================================
package main
import "fmt"
func main() {
word := "Hello"
letter := rune(word[0])
fmt.Println(letter)
}
================================================
FILE: 19_map/14_hash-table/01_letter-buckets/04_remainder-bucket-selection/main.go
================================================
package main
import "fmt"
func main() {
for i := 65; i <= 122; i++ {
fmt.Println(i, " - ", string(i), " - ", i%12)
}
}
================================================
FILE: 19_map/14_hash-table/01_letter-buckets/05_hash-function/main.go
================================================
package main
import "fmt"
func main() {
n := hashBucket("Go", 12)
fmt.Println(n)
}
func hashBucket(word string, buckets int) int {
letter := int(word[0])
bucket := letter % buckets
return bucket
}
================================================
FILE: 19_map/14_hash-table/01_letter-buckets/06_get/main.go
================================================
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
res, err := http.Get("http://www.gutenberg.org/files/2701/old/moby10b.txt")
if err != nil {
log.Fatal(err)
}
bs, err := ioutil.ReadAll(res.Body)
res.Body.Close()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s", bs)
}
================================================
FILE: 19_map/14_hash-table/01_letter-buckets/07_scanner/main.go
================================================
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func main() {
// An artificial input source.
const input = "It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming; but who does actually strive to do the deeds; who knows great enthusiasms, the great devotions; who spends himself in a worthy cause; who at the best knows in the end the triumph of high achievement, and who at the worst, if he fails, at least fails while daring greatly, so that his place shall never be with those cold and timid souls who neither know victory nor defeat. "
scanner := bufio.NewScanner(strings.NewReader(input))
// Set the split function for the scanning operation.
scanner.Split(bufio.ScanWords)
// Count the words.
for scanner.Scan() {
fmt.Println(scanner.Text())
}
if err := scanner.Err(); err != nil {
fmt.Fprintln(os.Stderr, "reading input:", err)
}
}
================================================
FILE: 19_map/14_hash-table/01_letter-buckets/08_moby-dicks-words/main.go
================================================
package main
import (
"bufio"
"fmt"
"log"
"net/http"
)
func main() {
// get the book moby dick
res, err := http.Get("http://www.gutenberg.org/files/2701/old/moby10b.txt")
if err != nil {
log.Fatal(err)
}
// scan the page
// NewScanner takes a reader and res.Body implements the reader interface (so it is a reader)
scanner := bufio.NewScanner(res.Body)
defer res.Body.Close()
// Set the split function for the scanning operation.
scanner.Split(bufio.ScanWords)
// Loop over the words
for scanner.Scan() {
fmt.Println(scanner.Text())
}
}
================================================
FILE: 19_map/14_hash-table/01_letter-buckets/09_int-slice-plus-plus/main.go
================================================
package main
import "fmt"
func main() {
buckets := make([]int, 1)
fmt.Println(buckets[0])
buckets[0] = 42
fmt.Println(buckets[0])
buckets[0]++
fmt.Println(buckets[0])
}
================================================
FILE: 19_map/14_hash-table/01_letter-buckets/10_hash-letter-buckets/main.go
================================================
package main
import (
"bufio"
"fmt"
"log"
"net/http"
)
func main() {
// get the book moby dick
res, err := http.Get("http://www.gutenberg.org/files/2701/old/moby10b.txt")
if err != nil {
log.Fatal(err)
}
// scan the page
scanner := bufio.NewScanner(res.Body)
defer res.Body.Close()
// Set the split function for the scanning operation.
scanner.Split(bufio.ScanWords)
// Create slice to hold counts
buckets := make([]int, 200)
// Loop over the words
for scanner.Scan() {
n := hashBucket(scanner.Text())
buckets[n]++
}
fmt.Println(buckets[65:123])
// fmt.Println("***************")
// for i := 28; i <= 126; i++ {
// fmt.Printf("%v - %c - %v \n", i, i, buckets[i])
// }
}
func hashBucket(word string) int {
return int(word[0])
}
================================================
FILE: 19_map/14_hash-table/01_letter-buckets/11_hash-remainder-buckets/main.go
================================================
package main
import (
"bufio"
"fmt"
"log"
"net/http"
)
func main() {
// get the book moby dick
res, err := http.Get("http://www.gutenberg.org/files/2701/old/moby10b.txt")
if err != nil {
log.Fatal(err)
}
// scan the page
scanner := bufio.NewScanner(res.Body)
defer res.Body.Close()
// Set the split function for the scanning operation.
scanner.Split(bufio.ScanWords)
// Create slice to hold counts
buckets := make([]int, 12)
// Loop over the words
for scanner.Scan() {
n := hashBucket(scanner.Text(), 12)
buckets[n]++
}
fmt.Println(buckets)
}
func hashBucket(word string, buckets int) int {
letter := int(word[0])
bucket := letter % buckets
return bucket
}
================================================
FILE: 19_map/14_hash-table/02_even-dstribution-hash/main.go
================================================
package main
import (
"bufio"
"fmt"
"log"
"net/http"
)
func main() {
// get the book adventures of sherlock holmes
res, err := http.Get("http://www.gutenberg.org/cache/epub/1661/pg1661.txt")
if err != nil {
log.Fatal(err)
}
// scan the page
scanner := bufio.NewScanner(res.Body)
defer res.Body.Close()
// Set the split function for the scanning operation.
scanner.Split(bufio.ScanWords)
// Create slice to hold counts
buckets := make([]int, 12)
// Loop over the words
for scanner.Scan() {
n := hashBucket(scanner.Text(), 12)
buckets[n]++
}
fmt.Println(buckets)
}
func hashBucket(word string, buckets int) int {
var sum int
for _, v := range word {
sum += int(v)
}
return sum % buckets
}
================================================
FILE: 19_map/14_hash-table/03_words-in-buckets/01_slice-bucket/main.go
================================================
package main
import (
"bufio"
"fmt"
"log"
"net/http"
)
func main() {
// get the book adventures of sherlock holmes
res, err := http.Get("http://www.gutenberg.org/cache/epub/1661/pg1661.txt")
if err != nil {
log.Fatal(err)
}
// scan the page
scanner := bufio.NewScanner(res.Body)
defer res.Body.Close()
// Set the split function for the scanning operation.
scanner.Split(bufio.ScanWords)
// Create slice of slice of string to hold slices of words
buckets := make([][]string, 12)
// code here has been updated from the recording
// see below for explanation
// Loop over the words
for scanner.Scan() {
word := scanner.Text()
n := hashBucket(word, 12)
buckets[n] = append(buckets[n], word)
}
// Print len of each bucket
for i := 0; i < 12; i++ {
fmt.Println(i, " - ", len(buckets[i]))
}
// Print the words in one of the buckets
// fmt.Println(buckets[6])
fmt.Println(len(buckets))
fmt.Println(cap(buckets))
}
func hashBucket(word string, buckets int) int {
var sum int
for _, v := range word {
sum += int(v)
}
return sum % buckets
// comment out the above, then uncomment the below
// a more uneven distribution
// return len(word) % buckets
}
/*
UPDATED CODE
Up above, the code has been updated from the recording
I used to have this ...
buckets = append(buckets, []string{})
... and changed it to this ...
buckets[i] = []string{}
REASON:
This line of code ...
buckets := make([][]string, 12)
... creates a slice with len and cap equal to 12. I can now access each of the twelve positions in the slice by index and assign values to them. If I "append" to this slice, like this ....
buckets = append(buckets, []string{})
... I am adding another twelve positions to my slice; my len increases to 24 and my cap increases to 24. This is unnecessary. I can, instead, just direclty begin accessing the first twelve positions in my slice ... and that's why I changed the code to this ...
buckets[i] = []string{}
EVEN MORE EXPLANATION
You don't even need this entire chunk of code ...
for i := 0; i < 12; i++ {
buckets[i] = []string{}
}
... as this code ...
buckets := make([][]string, 12)
... creates a slice holding a []string, but it doesn't yet have a len or cap, so later I use append which is how you add an item to a slice in a position that does not yet have an item (beyond its current len).
Thank you to Lee Trent for pointing this out!
*/
================================================
FILE: 19_map/14_hash-table/03_words-in-buckets/02_map-bucket/main.go
================================================
package main
import (
"bufio"
"fmt"
"log"
"net/http"
)
func main() {
// get the book adventures of sherlock holmes
res, err := http.Get("http://www.gutenberg.org/cache/epub/1661/pg1661.txt")
if err != nil {
log.Fatal(err)
}
// scan the page
scanner := bufio.NewScanner(res.Body)
defer res.Body.Close()
// Set the split function for the scanning operation.
scanner.Split(bufio.ScanWords)
// Create map with a key of int
// and a value of another map
// with a key of string, which will be the word
// and a value of int, which will be the number of times the word occurs
buckets := make(map[int]map[string]int)
// Create slices to hold words words
for i := 0; i < 12; i++ {
buckets[i] = make(map[string]int)
}
// Loop over the words
for scanner.Scan() {
word := scanner.Text()
n := hashBucket(word, 12)
buckets[n][word]++
}
// Print words in a bucket
for k, v := range buckets[6] {
fmt.Println(v, " \t- ", k)
}
}
func hashBucket(word string, buckets int) int {
var sum int
for _, v := range word {
sum += int(v)
}
return sum % buckets
}
================================================
FILE: 19_map/14_hash-table/04_english-alphabet/01/main.go
================================================
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
res, err := http.Get("http://www-01.sil.org/linguistics/wordlists/english/wordlist/wordsEn.txt")
if err != nil {
log.Fatalln(err)
}
bs, _ := ioutil.ReadAll(res.Body)
str := string(bs)
fmt.Println(str)
}
================================================
FILE: 19_map/14_hash-table/04_english-alphabet/02/main.go
================================================
package main
import (
"bufio"
"fmt"
"log"
"net/http"
"os"
)
func main() {
res, err := http.Get("http://www-01.sil.org/linguistics/wordlists/english/wordlist/wordsEn.txt")
if err != nil {
log.Fatalln(err)
}
words := make(map[string]string)
sc := bufio.NewScanner(res.Body)
sc.Split(bufio.ScanWords)
for sc.Scan() {
words[sc.Text()] = ""
}
if err := sc.Err(); err != nil {
fmt.Fprintln(os.Stderr, "reading input:", err)
}
i := 0
for k := range words {
fmt.Println(k)
if i == 200 {
break
}
i++
}
}
================================================
FILE: 20_struct/00_object-oriented/notes.txt
================================================
Go is Object Oriented
(1) Encapsulation
state ("fields")
behavior ("methods")
exported / un-exported
(2) Reusability
inheritance ("embedded types")
(3) Polymorphism
interfaces
(4) Overriding
"promotion"
//////////////
Traditional OOP
Classes
-- data structure describing a type of object
-- you can then create "instances"/"objects" from the class/blue-print
-- classes hold both:
==== state / data / fields
==== behavior / methods
-- public / private
Inheritance
//////////////
In Go:
- you don't create classes, you create a type
- you don't instantiate, you create a value of a type
================================================
FILE: 20_struct/01_user-defined-types/01_alias-type_not-idiomatic/main.go
================================================
package main
import "fmt"
type foo int
func main() {
var myAge foo
myAge = 44
fmt.Printf("%T %v \n", myAge, myAge)
}
================================================
FILE: 20_struct/01_user-defined-types/02_static-typing/main.go
================================================
package main
import "fmt"
type foo int
func main() {
var myAge foo
myAge = 44
fmt.Printf("%T %v \n", myAge, myAge)
var yourAge int
yourAge = 29
fmt.Printf("%T %v \n", yourAge, yourAge)
// this doesn't work:
// fmt.Println(myAge + yourAge)
// this conversion works:
// fmt.Println(int(myAge) + yourAge)
}
================================================
FILE: 20_struct/01_user-defined-types/notes.txt
================================================
user defined types - we declare a new type, foo
the underlying type of foo: int
conversion:int(myAge)
converting type foo to type int
THIS CODE IS ONLY FOR EXAMPLE
IT IS A BAD PRACTICE TO ALIAS TYPES
one exception: if you need to attach methods to a type
see the time package for an example of this
godoc.org/time
type Duration int64
Duration has methods attached to it
================================================
FILE: 20_struct/02_struct_fields_values_initialization/main.go
================================================
package main
import "fmt"
type person struct {
first string
last string
age int
}
func main() {
p1 := person{"James", "Bond", 20}
p2 := person{"Miss", "Moneypenny", 18}
fmt.Println(p1.first, p1.last, p1.age)
fmt.Println(p2.first, p2.last, p2.age)
}
================================================
FILE: 20_struct/02_struct_fields_values_initialization/notes.txt
================================================
We used shorthand notation:
to create a variable named p1 of type person
to create a variable named p2 of type person
We initialized those variables with specific values
We used the short variable declaration operator with a struct literal to initialize
----------------------------------------
here is how we talk about structs:
-- user defined type
-- we declare the type
-- the type has fields
-- the type can also have "tags"
---- we haven't seen this yet
-- the type has an underlying type
---- in this case, the underlying type is struct
-- we declare variables of the type
-- we initialize those variables
---- initialize with a specific value, or
---- or, initiliaze to the zero value
-- a struct is a composite type
----------------------------------------
Bill Kennedy:
Go allows us the ability to declare our own types.
Struct types are declared by composing a fixed set of unique fields together.
Each field in a struct is declared with a known type.
This could be a built-in type or another user defined type.
Once we have a type declared, we can create values from the type
When we declare variables, the value that the variable represents is always initialized.
The value can be initialized with a specific value or it can be initialized to its zero value
For numeric types, the zero value would be 0; for strings it would be empty;
and for booleans it would be false.
In the case of a struct, the zero value would apply to all the different fields in the struct.
Anytime a variable is created and initialized to its zero value, it is idiomatic to use the keyword var.
Reserve the use of the keyword var as a way to indicate that a variable is being set to its zero value.
If the variable will be initialized to something other than its zero value,
then use the short variable declaration operator with a struct literal
================================================
FILE: 20_struct/03_methods/main.go
================================================
package main
import "fmt"
type person struct {
first string
last string
age int
}
func (p person) fullName() string {
return p.first + p.last
}
func main() {
p1 := person{"James", "Bond", 20}
p2 := person{"Miss", "Moneypenny", 18}
fmt.Println(p1.fullName())
fmt.Println(p2.fullName())
}
================================================
FILE: 20_struct/03_methods/notes.txt
================================================
(p person) is the "receiver"
it is another parameter
not idiomatic to use "this" or "self"
"Not many people know this, but method notation, i.e. v.Method() is actually syntactic sugar and Go also understands the de-sugared version of it: (T).Method(v). You can see an example here. Naming the receiver like any other parameter reflects that it is, in fact, just another parameter quite well.
This also implies that the receiver-argument inside a method may be nil. This is not the case with this in e.g. Java."
SOURCE:
https://www.reddit.com/r/golang/comments/3qoo36/question_why_is_self_or_this_not_considered_a/?utm_source=golangweekly&utm_medium=email
================================================
FILE: 20_struct/04_embedded-types/main.go
================================================
package main
import (
"fmt"
)
type person struct {
First string
Last string
Age int
}
type doubleZero struct {
person
LicenseToKill bool
}
func main() {
p1 := doubleZero{
person: person{
First: "James",
Last: "Bond",
Age: 20,
},
LicenseToKill: true,
}
p2 := doubleZero{
person: person{
First: "Miss",
Last: "MoneyPenny",
Age: 19,
},
LicenseToKill: false,
}
fmt.Println(p1.First, p1.Last, p1.Age, p1.LicenseToKill)
fmt.Println(p2.First, p2.Last, p2.Age, p2.LicenseToKill)
}
================================================
FILE: 20_struct/05_promotion/01_overriding-fields/main.go
================================================
package main
import (
"fmt"
)
type person struct {
First string
Last string
Age int
}
type doubleZero struct {
person
First string
LicenseToKill bool
}
func main() {
p1 := doubleZero{
person: person{
First: "James",
Last: "Bond",
Age: 20,
},
First: "Double Zero Seven",
LicenseToKill: true,
}
p2 := doubleZero{
person: person{
First: "Miss",
Last: "MoneyPenny",
Age: 19,
},
First: "If looks could kill",
LicenseToKill: false,
}
// fields and methods of the inner-type are promoted to the outer-type
fmt.Println(p1.First, p1.person.First)
fmt.Println(p2.First, p2.person.First)
}
================================================
FILE: 20_struct/05_promotion/02_overriding-methods/main.go
================================================
package main
import (
"fmt"
)
type person struct {
Name string
Age int
}
type doubleZero struct {
person
LicenseToKill bool
}
func (p person) Greeting() {
fmt.Println("I'm just a regular person.")
}
func (dz doubleZero) Greeting() {
fmt.Println("Miss Moneypenny, so good to see you.")
}
func main() {
p1 := person{
Name: "Ian Flemming",
Age: 44,
}
p2 := doubleZero{
person: person{
Name: "James Bond",
Age: 23,
},
LicenseToKill: true,
}
p1.Greeting()
p2.Greeting()
p2.person.Greeting()
}
================================================
FILE: 20_struct/06_struct-pointer/main.go
================================================
package main
import "fmt"
type person struct {
name string
age int
}
func main() {
p1 := &person{"James", 20}
fmt.Println(p1)
fmt.Printf("%T\n", p1)
fmt.Println(p1.name)
fmt.Println(p1.age)
}
================================================
FILE: 20_struct/07_marshal_unmarshal/01_marshal/01_exported/main.go
================================================
package main
import (
"encoding/json"
"fmt"
)
type person struct {
First string
Last string
Age int
notExported int
}
func main() {
p1 := person{"James", "Bond", 20, 007}
bs, _ := json.Marshal(p1)
fmt.Println(bs)
fmt.Printf("%T \n", bs)
fmt.Println(string(bs))
}
================================================
FILE: 20_struct/07_marshal_unmarshal/01_marshal/02_unexported/main.go
================================================
package main
import (
"encoding/json"
"fmt"
)
type person struct {
first string
last string
age int
}
func main() {
p1 := person{"James", "Bond", 20}
fmt.Println(p1)
bs, _ := json.Marshal(p1)
fmt.Println(string(bs))
}
================================================
FILE: 20_struct/07_marshal_unmarshal/01_marshal/03_tags/main.go
================================================
package main
import (
"encoding/json"
"fmt"
)
type person struct {
First string
Last string `json:"-"`
Age int `json:"wisdom score"`
}
func main() {
p1 := person{"James", "Bond", 20}
bs, _ := json.Marshal(p1)
fmt.Println(string(bs))
}
================================================
FILE: 20_struct/07_marshal_unmarshal/02_unmarshal/01/main.go
================================================
package main
import (
"encoding/json"
"fmt"
)
type person struct {
First string
Last string
Age int
}
func main() {
var p1 person
fmt.Println(p1.First)
fmt.Println(p1.Last)
fmt.Println(p1.Age)
bs := []byte(`{"First":"James", "Last":"Bond", "Age":20}`)
json.Unmarshal(bs, &p1)
fmt.Println("--------------")
fmt.Println(p1.First)
fmt.Println(p1.Last)
fmt.Println(p1.Age)
fmt.Printf("%T \n", p1)
}
================================================
FILE: 20_struct/07_marshal_unmarshal/02_unmarshal/02_tags/main.go
================================================
package main
import (
"encoding/json"
"fmt"
)
type person struct {
First string
Last string
Age int `json:"wisdom score"`
}
func main() {
var p1 person
fmt.Println(p1.First)
fmt.Println(p1.Last)
fmt.Println(p1.Age)
bs := []byte(`{"First":"James", "Last":"Bond", "wisdom score":20}`)
json.Unmarshal(bs, &p1)
fmt.Println("--------------")
fmt.Println(p1.First)
fmt.Println(p1.Last)
fmt.Println(p1.Age)
fmt.Printf("%T \n", p1)
}
================================================
FILE: 20_struct/08_encode_decode/01_encode/main.go
================================================
package main
import (
"encoding/json"
"os"
)
type person struct {
First string
Last string
Age int
notExported int
}
func main() {
p1 := person{"James", "Bond", 20, 007}
json.NewEncoder(os.Stdout).Encode(p1)
}
================================================
FILE: 20_struct/08_encode_decode/02_decode/main.go
================================================
package main
import (
"encoding/json"
"fmt"
"strings"
)
type person struct {
First string
Last string
Age int
notExported int
}
func main() {
var p1 person
rdr := strings.NewReader(`{"First":"James", "Last":"Bond", "Age":20}`)
json.NewDecoder(rdr).Decode(&p1)
fmt.Println(p1.First)
fmt.Println(p1.Last)
fmt.Println(p1.Age)
}
================================================
FILE: 21_interfaces/00_notes.txt
================================================
"Polymorphism is the ability to write code that can take on different behavior through the
implementation of types. Once a type implements an interface, an entire world of
functionality can be opened up to values of that type."
- Bill Kennedy
"Interfaces are types that just declare behavior. This behavior is never implemented by the
interface type directly, but instead by user-defined types via methods. When a
user-defined type implements the set of methods declared by an interface type, values of
the user-defined type can be assigned to values of the interface type. This assignment
stores the value of the user-defined type into the interface value.
If a method call is made against an interface value, the equivalent method for the
stored user-defined value is executed. Since any user-defined type can implement any
interface, method calls against an interface value are polymorphic in nature. The
user-defined type in this relationship is often called a concrete type, since interface values
have no concrete behavior without the implementation of the stored user-defined value."
- Bill Kennedy
Receivers Values
-----------------------------------------------
(t T) T and *T
(t *T) *T
Values Receivers
-----------------------------------------------
T (t T)
*T (t T) and (t *T)
SOURCE:
Go In Action
William Kennedy
/////////////////////////////////////////////////////////////////////////
Interface types express generalizations or abstractions about the behaviors of other types.
By generalizing, interfaces let us write functions that are more flexible and adaptable
because they are not tied to the details of one particular implementation.
Many object-oriented lagnuages have some notion of interfaces, but what makes Go's interfaces
so distinctive is that they are SATISIFIED IMPLICITLY. In other words, there's no need to declare
all the interfaces that a given CONCRETE TYPE satisifies; simply possessing the necessary methods
is enough. This design lets you create new interfaces that are satisifed by existing CONCRETE TYPES
without changing the existing types, which is particularly useful for types defined in packages that
you don't control.
All the types we've looked at so far have been CONCRETE TYPES. A CONCRETE TYPE specifies the exact
representation of its values and exposes the intrinsic operations of that representation, such as
arithmetic for numbers, or indexing, append, and range for slices. A CONCRETE TYPE may also provide
additional behaviors through its methods. When you have a value of a CONCRETE TYPE, you know exactly
what is IS and what you can DO with it.
There is another kind of type in Go called an INTERFACE TYPE. An interface is an ABSTRACT TYPE. It doesn't
expose the representation or internal structure of its values, or the set of basic operations they support;
it reveals only some of their methods. When you have a value of an interface type, you know nothing about
what it IS; you know only what it can DO, or more precisely, what BEHAVIORS ARE PROVIDED BY ITS METHODS.
-------------------
type ReadWriter interface {
Reader
Writer
}
This is called EMBEDDING an interface.
-------------------
A type SATISFIES an interface if it possesses all the methods the interface requires.
-------------------
Conceptually, a value of an interface type, or INTERFACE VALUE, has two components,
a CONCRETE TYPE and a
VALUE OF THAT TYPE.
These are called the interface's
DYNAMIC TYPE and
DYNAMIC VALUE.
For a statically typed language like Go, types are a compile-time concept, so a type is not a value.
In our conceptual model, a set of values called TYPE DESCRIPTORS provide information about each type,
such as its name and methods. In an interface value, the type component is represented by the appropriate
type descriptor.
var w io.Writer
w = os.Stdout
w = new(bytes.Buffer)
w = nil
var w io.Writer
w
type: nil
value: nil
w = os.Stdout
w
type: *os.File
value: the address where a value of type os.File is stored
w = new(bytes.Buffer)
w
type: *bytes.Buffer
value: the address where a value of type bytes.Buffer is stored
w = nil
w
type: nil
value: nil
-------------------
The Go Programming Language
Donovan and Kernighan
Caplitalization and identation mine.
================================================
FILE: 21_interfaces/01_interface/01_no-interface/main.go
================================================
package main
import "fmt"
type square struct {
side float64
}
func (z square) area() float64 {
return z.side * z.side
}
func main() {
s := square{10}
fmt.Println("Area: ", s.area())
}
================================================
FILE: 21_interfaces/01_interface/02_interface/main.go
================================================
package main
import "fmt"
type square struct {
side float64
}
func (z square) area() float64 {
return z.side * z.side
}
type shape interface {
area() float64
}
func info(z shape) {
fmt.Println(z)
fmt.Println(z.area())
}
func main() {
s := square{10}
fmt.Printf("%T\n",s)
info(s)
}
================================================
FILE: 21_interfaces/01_interface/03_interface/main.go
================================================
package main
import (
"fmt"
"math"
)
type square struct {
side float64
}
// another shape
type circle struct {
radius float64
}
type shape interface {
area() float64
}
func (s square) area() float64 {
return s.side * s.side
}
// which implements the shape interface
func (c circle) area() float64 {
return math.Pi * c.radius * c.radius
}
func info(z shape) {
fmt.Println(z)
fmt.Println(z.area())
}
func main() {
s := square{10}
c := circle{5}
info(s)
info(c)
}
================================================
FILE: 21_interfaces/01_interface/04_interface/main.go
================================================
package main
import (
"fmt"
"math"
)
type circle struct {
radius float64
}
type square struct {
side float64
}
type shape interface {
area() float64
}
func (c circle) area() float64 {
return math.Pi * c.radius * c.radius
}
func (s square) area() float64 {
return s.side * s.side
}
func info(z shape) {
fmt.Println(z)
fmt.Println(z.area())
}
// a new method which takes the INTERFACE TYPE shape
func totalArea(shapes ...shape) float64 {
var area float64
for _, s := range shapes {
area += s.area()
}
return area
}
func main() {
s := square{10}
c := circle{5}
info(s)
info(c)
fmt.Println("Total Area: ", totalArea(c, s))
}
================================================
FILE: 21_interfaces/01_interface/05_io-copy/01_no-error-checking/main.go
================================================
package main
import (
"bytes"
"io"
"net/http"
"os"
"strings"
)
func main() {
msg := "Do not dwell in the past, do not dream of the future, concentrate the mind on the present."
rdr := strings.NewReader(msg)
io.Copy(os.Stdout, rdr)
rdr2 := bytes.NewBuffer([]byte(msg))
io.Copy(os.Stdout, rdr2)
res, _ := http.Get("http://www.mcleods.com")
io.Copy(os.Stdout, res.Body)
res.Body.Close()
}
================================================
FILE: 21_interfaces/01_interface/05_io-copy/02_error-checking/main.go
================================================
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
msg := "Do not dwell in the past, do not dream of the future, concentrate the mind on the present."
rdr := strings.NewReader(msg)
_, err := io.Copy(os.Stdout, rdr)
if err != nil {
fmt.Println(err)
return
}
rdr2 := bytes.NewBuffer([]byte(msg))
_, err = io.Copy(os.Stdout, rdr2)
if err != nil {
fmt.Println(err)
return
}
res, err := http.Get("http://www.mcleods.com")
if err != nil {
fmt.Println(err)
return
}
io.Copy(os.Stdout, res.Body)
if err := res.Body.Close(); err != nil {
fmt.Println(err)
}
}
================================================
FILE: 21_interfaces/02_package-sort/00_notes.txt
================================================
Use https://godoc.org/sort to sort the following:
(1)
type people []string
studyGroup := people{"Zeno", "John", "Al", "Jenny"}
(2)
s := []string{"Zeno", "John", "Al", "Jenny"}
(3)
n := []int{7, 4, 8, 2, 9, 19, 12, 32, 3}
Also sort the above in reverse order
================================================
FILE: 21_interfaces/02_package-sort/01_sort-names/main.go
================================================
package main
import (
"fmt"
"sort"
)
type people []string
func (p people) Len() int { return len(p) }
func (p people) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (p people) Less(i, j int) bool { return p[i] < p[j] }
func main() {
studyGroup := people{"Zeno", "John", "Al", "Jenny"}
fmt.Println(studyGroup)
sort.Sort(studyGroup)
fmt.Println(studyGroup)
}
// https://golang.org/pkg/sort/#Sort
// https://golang.org/pkg/sort/#Interface
================================================
FILE: 21_interfaces/02_package-sort/02_sort-names_type-StringSlice/main.go
================================================
package main
import (
"fmt"
"sort"
)
func main() {
s := []string{"Zeno", "John", "Al", "Jenny"}
fmt.Println(s)
// sort.StringSlice(s).Sort()
sort.Sort(sort.StringSlice(s))
fmt.Println(s)
}
// https://golang.org/pkg/sort/#Sort
================================================
FILE: 21_interfaces/02_package-sort/03_sort-Strings/main.go
================================================
package main
import (
"fmt"
"sort"
)
func main() {
s := []string{"Zeno", "John", "Al", "Jenny"}
sort.Strings(s)
fmt.Println(s)
}
================================================
FILE: 21_interfaces/02_package-sort/04_sort-names_type-StringSlice_reverse/main.go
================================================
package main
import (
"fmt"
"sort"
)
func main() {
s := []string{"Zeno", "John", "Al", "Jenny"}
fmt.Println(s)
sort.Sort(sort.Reverse(sort.StringSlice(s)))
fmt.Println(s)
// for experimentation to understand what's going on:
// uncomment and experiment with the code below:
// sort.Sort(sort.StringSlice(s))
// fmt.Println(s)
//
// fmt.Printf("just s: %T\n", s)
// s = sort.StringSlice(s)
// fmt.Printf("just s: %T\n", s)
// t := sort.StringSlice(s)
// fmt.Printf("just t: %T\n", t)
//
// fmt.Printf("s converted to StringSlice: %T\n", sort.StringSlice(s))
//// fmt.Printf("s sorted: %T\n", sort.Sort(sort.StringSlice(s)))
// fmt.Printf("s reversed: %T\n", sort.Reverse(sort.StringSlice(s)))
// i := sort.Reverse(sort.StringSlice(s))
// fmt.Println(i)
// fmt.Printf("%T\n", i)
// sort.Sort(i)
// fmt.Println(s)
}
// https://golang.org/pkg/sort/#Sort
================================================
FILE: 21_interfaces/02_package-sort/05_sort-int_type-IntSlice/main.go
================================================
package main
import (
"fmt"
"sort"
)
func main() {
n := []int{7, 4, 8, 2, 9, 19, 12, 32, 3}
fmt.Println(n)
sort.Sort(sort.IntSlice(n))
fmt.Println(n)
}
================================================
FILE: 21_interfaces/02_package-sort/06_sort-int_type-IntSlice_reverse/main.go
================================================
package main
import (
"fmt"
"sort"
)
func main() {
n := []int{7, 4, 8, 2, 9, 19, 12, 32, 3}
fmt.Println(n)
sort.Sort(sort.Reverse(sort.IntSlice(n)))
fmt.Println(n)
}
================================================
FILE: 21_interfaces/02_package-sort/07_sort-Ints/main.go
================================================
package main
import (
"fmt"
"sort"
)
func main() {
n := []int{5, 2, 6, 3, 1, 4}
sort.Ints(n)
fmt.Println(n)
}
================================================
FILE: 21_interfaces/02_package-sort/08_standard-library-example/main.go
================================================
package main
import (
"fmt"
"sort"
)
type person struct {
Name string
Age int
}
func (p person) String() string {
return fmt.Sprintf("YAYAYA %s: %d", p.Name, p.Age)
}
// ByAge implements sort.Interface for []person based on
// the Age field.
type ByAge []person
func (a ByAge) Len() int { return len(a) }
func (a ByAge) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a ByAge) Less(i, j int) bool { return a[i].Age < a[j].Age }
//func (a ByAge) Less(i, j int) bool { return a[i].Name < a[j].Name }
func main() {
people := []person{
{"Bob", 31},
{"John", 42},
{"Michael", 17},
{"Jenny", 26},
}
fmt.Println(people[0])
fmt.Println(people)
sort.Sort(ByAge(people))
fmt.Println(people)
}
// https://golang.org/pkg/sort/#Sort
// https://golang.org/pkg/sort/#Interface
// String() string
// https://golang.org/doc/effective_go.html#printing
================================================
FILE: 21_interfaces/03_empty-interface/01_no-interface/main.go
================================================
package main
import "fmt"
type vehicle struct {
Seats int
MaxSpeed int
Color string
}
type car struct {
vehicle
Wheels int
Doors int
}
type plane struct {
vehicle
Jet bool
}
type boat struct {
vehicle
Length int
}
func main() {
prius := car{}
tacoma := car{}
bmw528 := car{}
cars := []car{prius, tacoma, bmw528}
boeing747 := plane{}
boeing757 := plane{}
boeing767 := plane{}
planes := []plane{boeing747, boeing757, boeing767}
sanger := boat{}
nautique := boat{}
malibu := boat{}
boats := []boat{sanger, nautique, malibu}
for key, value := range cars {
fmt.Println(key, " - ", value)
}
for key, value := range planes {
fmt.Println(key, " - ", value)
}
for key, value := range boats {
fmt.Println(key, " - ", value)
}
}
================================================
FILE: 21_interfaces/03_empty-interface/02_empty-interface/main.go
================================================
package main
import "fmt"
type vehicles interface{}
type vehicle struct {
Seats int
MaxSpeed int
Color string
}
type car struct {
vehicle
Wheels int
Doors int
}
type plane struct {
vehicle
Jet bool
}
type boat struct {
vehicle
Length int
}
func main() {
prius := car{}
tacoma := car{}
bmw528 := car{}
boeing747 := plane{}
boeing757 := plane{}
boeing767 := plane{}
sanger := boat{}
nautique := boat{}
malibu := boat{}
rides := []vehicles{prius, tacoma, bmw528, boeing747, boeing757, boeing767, sanger, nautique, malibu}
for key, value := range rides {
fmt.Println(key, " - ", value)
}
}
================================================
FILE: 21_interfaces/03_empty-interface/03_param-accepts-any-type/main.go
================================================
package main
import "fmt"
type animal struct {
sound string
}
type dog struct {
animal
friendly bool
}
type cat struct {
animal
annoying bool
}
func specs(a interface{}) {
fmt.Println(a)
}
func main() {
fido := dog{animal{"woof"}, true}
fifi := cat{animal{"meow"}, true}
specs(fido)
specs(fifi)
}
================================================
FILE: 21_interfaces/03_empty-interface/04_slice-of-any-type/main.go
================================================
package main
import "fmt"
type animal struct {
sound string
}
type dog struct {
animal
friendly bool
}
type cat struct {
animal
annoying bool
}
func main() {
fido := dog{animal{"woof"}, true}
fifi := cat{animal{"meow"}, true}
shadow := dog{animal{"woof"}, true}
critters := []interface{}{fido, fifi, shadow}
fmt.Println(critters)
}
================================================
FILE: 21_interfaces/04_method-sets/01_value-receiver_value-type/main.go
================================================
package main
import (
"fmt"
"math"
)
type circle struct {
radius float64
}
type shape interface {
area() float64
}
func (c circle) area() float64 {
return math.Pi * c.radius * c.radius
}
func info(s shape) {
fmt.Println("area", s.area())
}
func main() {
c := circle{5}
info(c)
}
================================================
FILE: 21_interfaces/04_method-sets/02_value-receiver_pointer-type/main.go
================================================
package main
import (
"fmt"
"math"
)
type circle struct {
radius float64
}
type shape interface {
area() float64
}
func (c circle) area() float64 {
return math.Pi * c.radius * c.radius
}
func info(s shape) {
fmt.Println("area", s.area())
}
func main() {
c := circle{5}
info(&c)
}
================================================
FILE: 21_interfaces/04_method-sets/03_pointer-receiver_pointer-type/main.go
================================================
package main
import (
"fmt"
"math"
)
type circle struct {
radius float64
}
type shape interface {
area() float64
}
func (c *circle) area() float64 {
return math.Pi * c.radius * c.radius
}
func info(s shape) {
fmt.Println("area", s.area())
}
func main() {
c := circle{5}
info(&c)
}
================================================
FILE: 21_interfaces/04_method-sets/04_pointer-receiver_value-type/main.go
================================================
package main
import (
"fmt"
"math"
)
type circle struct {
radius float64
}
type shape interface {
area() float64
}
func (c *circle) area() float64 {
return math.Pi * c.radius * c.radius
}
func info(s shape) {
fmt.Println("area", s.area())
}
func main() {
c := circle{5}
info(c)
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/01_int-to-float/main.go
================================================
package main
import "fmt"
func main() {
var x = 12
var y = 12.1230123
fmt.Println(y + float64(x))
// conversion: int to float64
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/02_float-to-int/main.go
================================================
package main
import "fmt"
func main() {
var x = 12
var y = 12.1230123
fmt.Println(int(y) + x)
// conversion: float64 to int
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/03_rune-to-string/main.go
================================================
package main
import "fmt"
func main() {
var x rune = 'a' // rune is an alias for int32; normally omitted in this statement
var y int32 = 'b'
fmt.Println(x)
fmt.Println(y)
fmt.Println(string(x))
fmt.Println(string(y))
// conversion: rune to string
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/04_rune-to-slice-of-bytes-to-string/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(string([]byte{'h', 'e', 'l', 'l', 'o'}))
// conversion: []bytes to string
// we'll learn about []bytes soon
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/05_string-to-slice-of-bytes/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println([]byte("hello"))
// conversion: string to []bytes
// we'll learn about []bytes soon
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/06_strconv/01_Atoi/main.go
================================================
package main
import (
"fmt"
"strconv"
)
func main() {
var x = "12"
var y = 6
z, _ := strconv.Atoi(x)
fmt.Println(y + z)
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/06_strconv/02_Itoa/main.go
================================================
package main
import (
"fmt"
"strconv"
)
func main() {
x := 12
y := "I have this many: " + strconv.Itoa(x)
fmt.Println(y)
// fmt.Println("I have this many: ", strconv.Itoa(x), x)
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/06_strconv/03_ParseInt/main.go
================================================
package main
import (
"fmt"
"strconv"
)
func main() {
// ParseBool, ParseFloat, ParseInt, and ParseUint convert strings to values:
b, _ := strconv.ParseBool("true")
f, _ := strconv.ParseFloat("3.1415", 64)
i, _ := strconv.ParseInt("-42", 10, 64)
u, _ := strconv.ParseUint("42", 10, 64)
fmt.Println(b, f, i, u)
// FormatBool, FormatFloat, FormatInt, and FormatUint convert values to strings:
w := strconv.FormatBool(true)
x := strconv.FormatFloat(3.1415, 'E', -1, 64)
y := strconv.FormatInt(-42, 16)
z := strconv.FormatUint(42, 16)
fmt.Println(w, x, y, z)
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/01_non-interface-error_invalid-code/main.go
================================================
package main
import "fmt"
func main() {
name := "Sydney"
str, ok := name.(string)
if ok {
fmt.Printf("%q\n", str)
} else {
fmt.Printf("value is not a string\n")
}
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/02_interface-string/main.go
================================================
package main
import "fmt"
func main() {
var name interface{} = "Sydney"
str, ok := name.(string)
if ok {
fmt.Printf("%T\n", str)
} else {
fmt.Printf("value is not a string\n")
}
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/03_interface-string_not-ok/main.go
================================================
package main
import "fmt"
func main() {
var name interface{} = 7
str, ok := name.(string)
if ok {
fmt.Printf("%T\n", str)
} else {
fmt.Printf("value is not a string\n")
}
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/04_interface-int_print-type/main.go
================================================
package main
import "fmt"
func main() {
var val interface{} = 7
fmt.Printf("%T\n", val)
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/05_interface-int_mistmatched-types-error/main.go
================================================
package main
import "fmt"
func main() {
var val interface{} = 7
fmt.Println(val + 6)
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/06_interface-int-sum/main.go
================================================
package main
import "fmt"
func main() {
var val interface{} = 7
fmt.Println(val.(int) + 6)
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/07_casting-reminder/main.go
================================================
package main
import "fmt"
func main() {
rem := 7.24
fmt.Printf("%T\n", rem)
fmt.Printf("%T\n", int(rem))
}
================================================
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/08_interface-cast-error_need-type-assertion/main.go
================================================
package main
import "fmt"
func main() {
rem := 7.24
fmt.Printf("%T\n", rem)
fmt.Printf("%T\n", int(rem))
var val interface{} = 7
fmt.Printf("%T\n", val)
fmt.Printf("%T\n", int(val))
// fmt.Printf("%T\n", val.(int))
}
================================================
FILE: 22_go-routines/01_no-go/main.go
================================================
package main
import "fmt"
func main() {
foo()
bar()
}
func foo() {
for i := 0; i < 45; i++ {
fmt.Println("Foo:", i)
}
}
func bar() {
for i := 0; i < 45; i++ {
fmt.Println("Bar:", i)
}
}
================================================
FILE: 22_go-routines/02_go_concurrency/main.go
================================================
package main
import "fmt"
func main() {
go foo()
go bar()
}
func foo() {
for i := 0; i < 45; i++ {
fmt.Println("Foo:", i)
}
}
func bar() {
for i := 0; i < 45; i++ {
fmt.Println("Bar:", i)
}
}
================================================
FILE: 22_go-routines/03_wait-group/main.go
================================================
package main
import (
"fmt"
"sync"
)
var wg sync.WaitGroup
func main() {
wg.Add(2)
go foo()
go bar()
wg.Wait()
}
func foo() {
for i := 0; i < 45; i++ {
fmt.Println("Foo:", i)
}
wg.Done()
}
func bar() {
for i := 0; i < 45; i++ {
fmt.Println("Bar:", i)
}
wg.Done()
}
================================================
FILE: 22_go-routines/04_time-sleep/main.go
================================================
package main
import (
"fmt"
"sync"
"time"
)
var wg sync.WaitGroup
func main() {
wg.Add(2)
go foo()
go bar()
wg.Wait()
}
func foo() {
for i := 0; i < 45; i++ {
fmt.Println("Foo:", i)
time.Sleep(3 * time.Millisecond)
}
wg.Done()
}
func bar() {
for i := 0; i < 45; i++ {
fmt.Println("Bar:", i)
time.Sleep(20 * time.Millisecond)
}
wg.Done()
}
================================================
FILE: 22_go-routines/05_gomaxprocs_parallelism/main.go
================================================
package main
import (
"fmt"
"runtime"
"sync"
"time"
)
var wg sync.WaitGroup
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
}
func main() {
wg.Add(2)
go foo()
go bar()
wg.Wait()
}
func foo() {
for i := 0; i < 45; i++ {
fmt.Println("Foo:", i)
time.Sleep(3 * time.Millisecond)
}
wg.Done()
}
func bar() {
for i := 0; i < 45; i++ {
fmt.Println("Bar:", i)
time.Sleep(20 * time.Millisecond)
}
wg.Done()
}
================================================
FILE: 22_go-routines/06_race-condition/main.go
================================================
package main
import (
"fmt"
"math/rand"
"sync"
"time"
)
var wg sync.WaitGroup
var counter int
func main() {
wg.Add(2)
go incrementor("Foo:")
go incrementor("Bar:")
wg.Wait()
fmt.Println("Final Counter:", counter)
}
func incrementor(s string) {
rand.Seed(time.Now().UnixNano())
for i := 0; i < 20; i++ {
x := counter
x++
time.Sleep(time.Duration(rand.Intn(3)) * time.Millisecond)
counter = x
fmt.Println(s, i, "Counter:", counter)
}
wg.Done()
}
// go run -race main.go
// vs
// go run main.go
================================================
FILE: 22_go-routines/07_mutex/main.go
================================================
package main
import (
"fmt"
"math/rand"
"sync"
"time"
)
var wg sync.WaitGroup
var counter int
var mutex sync.Mutex
func main() {
wg.Add(2)
go incrementor("Foo:")
go incrementor("Bar:")
wg.Wait()
fmt.Println("Final Counter:", counter)
}
func incrementor(s string) {
for i := 0; i < 20; i++ {
time.Sleep(time.Duration(rand.Intn(20)) * time.Millisecond)
mutex.Lock()
counter++
fmt.Println(s, i, "Counter:", counter)
mutex.Unlock()
}
wg.Done()
}
// go run -race main.go
// vs
// go run main.go
================================================
FILE: 22_go-routines/08_atomicity/main.go
================================================
package main
import (
"fmt"
"math/rand"
"sync"
"sync/atomic"
"time"
)
var wg sync.WaitGroup
var counter int64
func main() {
wg.Add(2)
go incrementor("Foo:")
go incrementor("Bar:")
wg.Wait()
fmt.Println("Final Counter:", counter)
}
func incrementor(s string) {
for i := 0; i < 20; i++ {
time.Sleep(time.Duration(rand.Intn(3)) * time.Millisecond)
atomic.AddInt64(&counter, 1)
fmt.Println(s, i, "Counter:", atomic.LoadInt64(&counter)) // access without race
}
wg.Done()
}
// go run -race main.go
// vs
// go run main.go
================================================
FILE: 22_go-routines/09_channels/00_unbuffered-channels-block/main.go
================================================
package main
import (
"fmt"
"time"
)
func main() {
c := make(chan int)
go func() {
for i := 0; i < 10; i++ {
c <- i
}
}()
go func() {
for {
fmt.Println(<-c)
}
}()
time.Sleep(time.Second)
}
================================================
FILE: 22_go-routines/09_channels/01_range/main.go
================================================
package main
import (
"fmt"
)
func main() {
c := make(chan int)
go func() {
for i := 0; i < 10; i++ {
c <- i
}
close(c)
}()
for n := range c {
fmt.Println(n)
}
}
================================================
FILE: 22_go-routines/09_channels/02_n-to-1/01_race-condition/main.go
================================================
package main
import (
"fmt"
"sync"
)
func main() {
c := make(chan int)
var wg sync.WaitGroup
go func() {
wg.Add(1)
for i := 0; i < 10; i++ {
c <- i
}
wg.Done()
}()
go func() {
wg.Add(1)
for i := 0; i < 10; i++ {
c <- i
}
wg.Done()
}()
go func() {
wg.Wait()
close(c)
}()
for n := range c {
fmt.Println(n)
}
}
================================================
FILE: 22_go-routines/09_channels/02_n-to-1/02_wait-group/main.go
================================================
package main
import (
"fmt"
"sync"
)
func main() {
c := make(chan int)
var wg sync.WaitGroup
wg.Add(2)
go func() {
for i := 0; i < 10; i++ {
c <- i
}
wg.Done()
}()
go func() {
for i := 0; i < 10; i++ {
c <- i
}
wg.Done()
}()
go func() {
wg.Wait()
close(c)
}()
for n := range c {
fmt.Println(n)
}
}
================================================
FILE: 22_go-routines/09_channels/02_n-to-1/03_semaphore/main.go
================================================
package main
import (
"fmt"
)
func main() {
c := make(chan int)
done := make(chan bool)
go func() {
for i := 0; i < 10; i++ {
c <- i
}
done <- true
}()
go func() {
for i := 0; i < 10; i++ {
c <- i
}
done <- true
}()
go func() {
<-done
<-done
close(c)
}()
for n := range c {
fmt.Println(n)
}
}
================================================
FILE: 22_go-routines/09_channels/02_n-to-1/04_semaphore_wrong-way/main.go
================================================
package main
import (
"fmt"
)
func main() {
c := make(chan int)
done := make(chan bool)
go func() {
for i := 0; i < 10; i++ {
c <- i
}
done <- true
}()
go func() {
for i := 0; i < 10; i++ {
c <- i
}
done <- true
}()
// we block here until done <- true
<-done
<-done
close(c)
// to unblock above
// we need to take values off of chan c here
// but we never get here, because we're blocked above
for n := range c {
fmt.Println(n)
}
}
================================================
FILE: 22_go-routines/09_channels/02_n-to-1/05_n-times_to_1/main.go
================================================
package main
import (
"fmt"
)
func main() {
n := 10
c := make(chan int)
done := make(chan bool)
for i := 0; i < n; i++ {
go func() {
for i := 0; i < 10; i++ {
c <- i
}
done <- true
}()
}
go func() {
for i := 0; i < n; i++ {
<-done
}
close(c)
}()
for n := range c {
fmt.Println(n)
}
}
================================================
FILE: 22_go-routines/09_channels/03_1-to-n/01_1_to_2-times/main.go
================================================
package main
import (
"fmt"
)
func main() {
c := make(chan int)
done := make(chan bool)
go func() {
for i := 0; i < 100000; i++ {
c <- i
}
close(c)
}()
go func() {
for n := range c {
fmt.Println(n)
}
done <- true
}()
go func() {
for n := range c {
fmt.Println(n)
}
done <- true
}()
<-done
<-done
}
================================================
FILE: 22_go-routines/09_channels/03_1-to-n/02_1_to_n-times/main.go
================================================
package main
import (
"fmt"
)
func main() {
n := 10
c := make(chan int)
done := make(chan bool)
go func() {
for i := 0; i < 100000; i++ {
c <- i
}
close(c)
}()
for i := 0; i < n; i++ {
go func() {
for n := range c {
fmt.Println(n)
}
done <- true
}()
}
for i := 0; i < n; i++ {
<-done
}
}
================================================
FILE: 22_go-routines/09_channels/04_pass-return-channels/main.go
================================================
package main
import "fmt"
func main() {
c := incrementor()
cSum := puller(c)
for n := range cSum {
fmt.Println(n)
}
}
func incrementor() chan int {
out := make(chan int)
go func() {
for i := 0; i < 10; i++ {
out <- i
}
close(out)
}()
return out
}
func puller(c chan int) chan int {
out := make(chan int)
go func() {
var sum int
for n := range c {
sum += n
}
out <- sum
close(out)
}()
return out
}
================================================
FILE: 22_go-routines/09_channels/05_channel-direction/main.go
================================================
package main
import "fmt"
func main() {
c := incrementor()
cSum := puller(c)
for n := range cSum {
fmt.Println(n)
}
}
func incrementor() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 10; i++ {
out <- i
}
close(out)
}()
return out
}
func puller(c <-chan int) <-chan int {
out := make(chan int)
go func() {
var sum int
for n := range c {
sum += n
}
out <- sum
close(out)
}()
return out
}
/*
The optional <- operator specifies the channel direction, send or receive.
If no direction is given, the channel is bidirectional.
https://golang.org/ref/spec#Channel_types
*/
================================================
FILE: 22_go-routines/09_channels/06_refactor/main.go
================================================
package main
import "fmt"
func main() {
c := incrementor()
for n := range puller(c) {
fmt.Println(n)
}
}
func incrementor() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 10; i++ {
out <- i
}
close(out)
}()
return out
}
func puller(c <-chan int) <-chan int {
out := make(chan int)
go func() {
var sum int
for n := range c {
sum += n
}
out <- sum
close(out)
}()
return out
}
================================================
FILE: 22_go-routines/09_channels/07_incrementor/main.go
================================================
package main
import (
"fmt"
)
func main() {
c1 := incrementor("Foo:")
c2 := incrementor("Bar:")
c3 := puller(c1)
c4 := puller(c2)
fmt.Println("Final Counter:", <-c3+<-c4)
}
func incrementor(s string) chan int {
out := make(chan int)
go func() {
for i := 0; i < 20; i++ {
out <- 1
fmt.Println(s, i)
}
close(out)
}()
return out
}
func puller(c chan int) chan int {
out := make(chan int)
go func() {
var sum int
for n := range c {
sum += n
}
out <- sum
close(out)
}()
return out
}
================================================
FILE: 22_go-routines/09_channels/08_closures/01_no-closure-binding/main.go
================================================
package main
import "fmt"
func main() {
done := make(chan bool)
values := []string{"a", "b", "c"}
for _, v := range values {
go func() {
fmt.Println(v)
done <- true
}()
}
// wait for all goroutines to complete before exiting
for _ = range values {
<-done
}
}
/*
Some confusion may arise when using closures with concurrency.
One might mistakenly expect to see a, b, c as the output.
What you'll probably see instead is c, c, c. This is because
each iteration of the loop uses the same instance of the variable v,
so each closure shares that single variable. When the closure runs,
it prints the value of v at the time fmt.Println is executed,
but v may have been modified since the goroutine was launched.
To help detect this and other problems before they happen,
run go vet.
SOURCE:
https://golang.org/doc/faq#closures_and_goroutines
*/
================================================
FILE: 22_go-routines/09_channels/08_closures/02_closure-binding/main.go
================================================
package main
import "fmt"
func main() {
done := make(chan bool)
values := []string{"a", "b", "c"}
for _, v := range values {
go func(u string) {
fmt.Println(u)
done <- true
}(v)
}
// wait for all goroutines to complete before exiting
for _ = range values {
<-done
}
}
/*
To bind the current value of v to each closure as it is launched,
one must modify the inner loop to create a new variable each iteration.
One way is to pass the variable as an argument to the closure.
In this example, the value of v is passed as an argument to the anonymous function.
That value is then accessible inside the function as the variable u.
SOURCE:
https://golang.org/doc/faq#closures_and_goroutines
*/
================================================
FILE: 22_go-routines/09_channels/08_closures/03_closure-binding/main.go
================================================
package main
import "fmt"
func main() {
done := make(chan bool)
values := []string{"a", "b", "c"}
for _, v := range values {
v := v // create a new 'v'.
go func() {
fmt.Println(v)
done <- true
}()
}
// wait for all goroutines to complete before exiting
for _ = range values {
<-done
}
}
/*
Even easier is just to create a new variable,
using a declaration style that may seem odd but works fine in Go.
SOURCE:
https://golang.org/doc/faq#closures_and_goroutines
*/
================================================
FILE: 22_go-routines/10_deadlock-challenges/01_deadlock-challenge/main.go
================================================
package main
import (
"fmt"
)
func main() {
c := make(chan int)
c <- 1
fmt.Println(<-c)
}
// This results in a deadlock.
// Can you determine why?
// And what would you do to fix it?
================================================
FILE: 22_go-routines/10_deadlock-challenges/02_deadlock-solution/main.go
================================================
package main
import (
"fmt"
)
func main() {
c := make(chan int)
go func() {
c <- 1
}()
fmt.Println(<-c)
}
================================================
FILE: 22_go-routines/10_deadlock-challenges/03_deadlock-challenge/main.go
================================================
package main
import (
"fmt"
)
func main() {
c := make(chan int)
go func() {
for i := 0; i < 10; i++ {
c <- i
}
}()
fmt.Println(<-c)
}
// Why does this only print zero?
// And what can you do to get it to print all 0 - 9 numbers?
================================================
FILE: 22_go-routines/10_deadlock-challenges/04_deadlock-challenge/main.go
================================================
package main
import (
"fmt"
)
func main() {
c := make(chan int)
go func() {
for i := 0; i < 10; i++ {
c <- i
}
}()
for {
fmt.Println(<-c)
}
}
// This prints the number, but we have received this error:
// fatal error: all goroutines are asleep - deadlock!
// Where is the deadlock?
// Why are all goroutines asleep?
// How can we fix this?
================================================
FILE: 22_go-routines/10_deadlock-challenges/05_deadlock-solution/main.go
================================================
package main
import (
"fmt"
)
func main() {
c := make(chan int)
go func() {
for i := 0; i < 10; i++ {
c <- i
}
close(c)
}()
for n := range c {
fmt.Println(n)
}
}
// remember to close your channel
// if you do not close your channel, you will receive this error
// fatal error: all goroutines are asleep - deadlock!
// ************** IMPORTANT **************
// YOU NEED GO VERSION 1.5.2 OR GREATER
// otherwise you will receive this error
// fatal error: all goroutines are asleep - deadlock!
================================================
FILE: 22_go-routines/11_factorial-challenge/01_challenge-description/main.go
================================================
package main
import (
"fmt"
)
func main() {
f := factorial(4)
fmt.Println("Total:", f)
}
func factorial(n int) int {
total := 1
for i := n; i > 0; i-- {
total *= i
}
return total
}
/*
CHALLENGE #1:
-- Use goroutines and channels to calculate factorial
CHALLENGE #2:
-- Why might you want to use goroutines and channels to calculate factorial?
---- Formulate your own answer, then post that answer to this discussion area: https://goo.gl/flGsyX
---- Read a few of the other answers at the discussion area to see the reasons of others
*/
================================================
FILE: 22_go-routines/11_factorial-challenge/02_challenge-solution/main.go
================================================
package main
import (
"fmt"
)
func main() {
c := factorial(4)
for n := range c {
fmt.Println(n)
}
}
func factorial(n int) chan int {
out := make(chan int)
go func() {
total := 1
for i := n; i > 0; i-- {
total *= i
}
out <- total
close(out)
}()
return out
}
================================================
FILE: 22_go-routines/12_channels_pipeline/01_sq-output/main.go
================================================
package main
import "fmt"
func main() {
// Set up the pipeline.
c := gen(2, 3)
out := sq(c)
// Consume the output.
fmt.Println(<-out) // 4
fmt.Println(<-out) // 9
}
func gen(nums ...int) chan int {
out := make(chan int)
go func() {
for _, n := range nums {
out <- n
}
close(out)
}()
return out
}
func sq(in chan int) chan int {
out := make(chan int)
go func() {
for n := range in {
out <- n * n
}
close(out)
}()
return out
}
================================================
FILE: 22_go-routines/12_channels_pipeline/02_sq-output/main.go
================================================
package main
import "fmt"
func main() {
// Set up the pipeline and consume the output.
for n := range sq(sq(gen(2, 3))) {
fmt.Println(n) // 16 then 81
}
}
func gen(nums ...int) chan int {
out := make(chan int)
go func() {
for _, n := range nums {
out <- n
}
close(out)
}()
return out
}
func sq(in chan int) chan int {
out := make(chan int)
go func() {
for n := range in {
out <- n * n
}
close(out)
}()
return out
}
================================================
FILE: 22_go-routines/12_channels_pipeline/03_challenge-description/main.go
================================================
package main
import (
"fmt"
)
func main() {
c := factorial(4)
for n := range c {
fmt.Println(n)
}
}
func factorial(n int) chan int {
out := make(chan int)
go func() {
total := 1
for i := n; i > 0; i-- {
total *= i
}
out <- total
close(out)
}()
return out
}
/*
CHALLENGE #1:
-- Change the code above to execute 100 factorial computations concurrently and in parallel.
-- Use the "pipeline" pattern to accomplish this
POST TO DISCUSSION:
-- What realizations did you have about working with concurrent code when building your solution?
-- eg, what insights did you have which helped you understand working with concurrency?
-- Post your answer, and read other answers, here: https://goo.gl/uJa99G
*/
================================================
FILE: 22_go-routines/12_channels_pipeline/04_challenge-solution/01_original-solution/main.go
================================================
package main
import (
"fmt"
)
func main() {
in := gen()
f := factorial(in)
for n := range f {
fmt.Println(n)
}
}
func gen() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 10; i++ {
for j := 3; j < 13; j++ {
out <- j
}
}
close(out)
}()
return out
}
func factorial(in <-chan int) <-chan int {
out := make(chan int)
go func() {
for n := range in {
out <- fact(n)
}
close(out)
}()
return out
}
func fact(n int) int {
total := 1
for i := n; i > 0; i-- {
total *= i
}
return total
}
================================================
FILE: 22_go-routines/12_channels_pipeline/04_challenge-solution/02_another-solution/main.go
================================================
package main
import (
"fmt"
"math/rand"
"sync"
)
const numFactorials = 100
const rdLimit = 20
func main() {
var w sync.WaitGroup
w.Add(numFactorials)
factorial(&w)
w.Wait()
}
func factorial(wmain *sync.WaitGroup) {
var w sync.WaitGroup
rand.Seed(42)
w.Add(numFactorials + 1)
for j := 1; j <= numFactorials; j++ {
go func() {
f := rand.Intn(rdLimit)
w.Wait()
total := 1
for i := f; i > 0; i-- {
total *= i
}
fmt.Println(f, total)
(*wmain).Done()
//out <- total
}()
w.Done()
}
fmt.Println("All done with initialization")
w.Done()
}
================================================
FILE: 22_go-routines/12_channels_pipeline/04_challenge-solution/README.md
================================================
A student sent me the below note so I included the student's excellent solution to this project:
Todd, I reviewed your solution to 22_go-routines/04_challenge-solution in your Golang Programming class.
I believe your solution might not run 100 factorial computations concurrently and in parallel as the following statement will calculate the factorials sequentially, since it is receiving them - one by one - from the pipeline:
out <- fact(n)
I used the sync package to create a solution that I believe will accomplish your goal. Let me know if I am missing something:
https://github.com/arsanjea/udemyTraining/blob/master/Exercises/exercise38.go
/////
# Definitions
## concurrency
a design pattern
go uses goroutines to create concurrent design patterns
## parallelism
running code from a program on more than one cpu
parallelism implies you have used concurrent design patterns
## sequentially
one thing happening after another, in sequence
# here are my thoughts
The original solution uses concurrent design patterns. It uses two different goroutines. The [control flow](https://en.wikipedia.org/wiki/Control_flow) of the program is no longer a straight top-to-bottom sequence. Different goroutines have been launched.
The program may or may not run in parallel. If the program is run on a machine with two or more cpus, the program has the potential to run in parallel. Each of our three goroutines (the two goroutines we launched, and main) could be running on different cpu cores.
Jean-Marc Arsan is correct: the program IS still running sequentially. Even though calculations are occuring in different goroutines, and potentially on different CPU cores, the sequence in which they occur is still sequential.
goroutines allow synchronization of code.
In this original example, the code is synchronized.
Thank you, Jean-Marc, for your comment on this code!
I appreciate these discussions and hope the notes and your new code sample are helpful to everyone!
================================================
FILE: 22_go-routines/13_channels_fan-out_fan-in/01_boring/main.go
================================================
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
c := fanIn(boring("Joe"), boring("Ann"))
for i := 0; i < 10; i++ {
fmt.Println(<-c)
}
fmt.Println("You're both boring; I'm leaving.")
}
func boring(msg string) <-chan string {
c := make(chan string)
go func() {
for i := 0; ; i++ {
c <- fmt.Sprintf("%s %d", msg, i)
time.Sleep(time.Duration(rand.Intn(1e3)) * time.Millisecond)
}
}()
return c
}
// FAN IN
func fanIn(input1, input2 <-chan string) <-chan string {
c := make(chan string)
go func() {
for {
c <- <-input1
}
}()
go func() {
for {
c <- <-input2
}
}()
return c
}
/*
code source:
Rob Pike
https://talks.golang.org/2012/concurrency.slide#25
*/
/*
FAN OUT
Multiple functions reading from the same channel until that channel is closed
FAN IN
A function can read from multiple inputs and proceed until all are closed by
multiplexing the input channels onto a single channel that's closed when
all the inputs are closed.
PATTERN
there's a pattern to our pipeline functions:
-- stages close their outbound channels when all the send operations are done.
-- stages keep receiving values from inbound channels until those channels are closed.
source:
https://blog.golang.org/pipelines
*/
================================================
FILE: 22_go-routines/13_channels_fan-out_fan-in/02_sq-output/main.go
================================================
package main
import (
"fmt"
"sync"
)
func main() {
in := gen(2, 3)
// FAN OUT
// Distribute the sq work across two goroutines that both read from in.
c1 := sq(in)
c2 := sq(in)
// FAN IN
// Consume the merged output from multiple channels.
for n := range merge(c1, c2) {
fmt.Println(n) // 4 then 9, or 9 then 4
}
}
func gen(nums ...int) chan int {
fmt.Printf("TYPE OF NUMS %T\n", nums) // just FYI
out := make(chan int)
go func() {
for _, n := range nums {
out <- n
}
close(out)
}()
return out
}
func sq(in chan int) chan int {
out := make(chan int)
go func() {
for n := range in {
out <- n * n
}
close(out)
}()
return out
}
func merge(cs ...chan int) chan int {
fmt.Printf("TYPE OF CS: %T\n", cs) // just FYI
out := make(chan int)
var wg sync.WaitGroup
wg.Add(len(cs))
for _, c := range cs {
go func(ch chan int) {
for n := range ch {
out <- n
}
wg.Done()
}(c)
}
go func() {
wg.Wait()
close(out)
}()
return out
}
/*
FAN OUT
Multiple functions reading from the same channel until that channel is closed
FAN IN
A function can read from multiple inputs and proceed until all are closed by
multiplexing the input channels onto a single channel that's closed when
all the inputs are closed.
PATTERN
there's a pattern to our pipeline functions:
-- stages close their outbound channels when all the send operations are done.
-- stages keep receiving values from inbound channels until those channels are closed.
source:
https://blog.golang.org/pipelines
*/
/*
CHALLENGE #1
When know HOW to do fan out / fan in, but do we know WHY?
Why would we want to do fan out / fan in?
*/
================================================
FILE: 22_go-routines/13_channels_fan-out_fan-in/03_sq-output_variation/main.go
================================================
package main
import (
"fmt"
"sync"
)
func main() {
in := gen(2, 3)
// Distribute the sq work across two goroutines that both read from in.
c1 := sq(in)
c2 := sq(in)
// Consume the merged output from c1 and c2.
for n := range merge(c1, c2) {
fmt.Println(n) // 4 then 9, or 9 then 4
}
}
func gen(nums ...int) <-chan int {
out := make(chan int)
go func() {
for _, n := range nums {
out <- n
}
close(out)
}()
return out
}
func sq(in <-chan int) <-chan int {
out := make(chan int)
go func() {
for n := range in {
out <- n * n
}
close(out)
}()
return out
}
func merge(cs ...<-chan int) <-chan int {
var wg sync.WaitGroup
out := make(chan int)
// Start an output goroutine for each input channel in cs.
// output copies values from c to out until c is closed, then calls wg.Done.
output := func(c <-chan int) {
for n := range c {
out <- n
}
wg.Done()
}
wg.Add(len(cs))
for _, c := range cs {
go output(c)
}
// Start a goroutine to close out once all the output goroutines are
// done. This must start after the wg.Add call.
go func() {
wg.Wait()
close(out)
}()
return out
}
/*
FAN OUT
Multiple functions reading from the same channel until that channel is closed
FAN IN
A function can read from multiple inputs and proceed until all are closed by
multiplexing the input channels onto a single channel that's closed when
all the inputs are closed.
PATTERN
there's a pattern to our pipeline functions:
-- stages close their outbound channels when all the send operations are done.
-- stages keep receiving values from inbound channels until those channels are closed.
source:
https://blog.golang.org/pipelines
*/
================================================
FILE: 22_go-routines/13_channels_fan-out_fan-in/04_challenge-description/main.go
================================================
package main
import (
"fmt"
"time"
)
var workerID int
var publisherID int
func main() {
input := make(chan string)
go workerProcess(input)
go workerProcess(input)
go workerProcess(input)
go publisher(input)
go publisher(input)
go publisher(input)
go publisher(input)
time.Sleep(1 * time.Millisecond)
}
// publisher pushes data into a channel
func publisher(out chan string) {
publisherID++
thisID := publisherID
dataID := 0
for {
dataID++
fmt.Printf("publisher %d is pushing data\n", thisID)
data := fmt.Sprintf("Data from publisher %d. Data %d", thisID, dataID)
out <- data
}
}
func workerProcess(in <-chan string) {
workerID++
thisID := workerID
for {
fmt.Printf("%d: waiting for input...\n", thisID)
input := <-in
fmt.Printf("%d: input is: %s\n", thisID, input)
}
}
/*
CHALLENGE #1
Is this fan out?
CHALLENGE #2
Is this fan in?
*/
================================================
FILE: 22_go-routines/13_channels_fan-out_fan-in/05_challenge-solution/main.go
================================================
package main
import (
"fmt"
"time"
"sync/atomic"
)
var workerID int64
var publisherID int64
func main() {
input := make(chan string)
go workerProcess(input)
go workerProcess(input)
go workerProcess(input)
go publisher(input)
go publisher(input)
go publisher(input)
go publisher(input)
time.Sleep(1 * time.Millisecond)
}
// publisher pushes data into a channel
func publisher(out chan string) {
atomic.AddInt64(&publisherID, 1)
// atomic was added after recording to fix a race condition
// discover race conditions with the -race flag
// for example: go run -race main.go
// learn about the atomic package: https://godoc.org/sync/atomic#AddInt64
thisID := atomic.LoadInt64(&publisherID)
dataID := 0
for {
dataID++
fmt.Printf("publisher %d is pushing data\n", thisID)
data := fmt.Sprintf("Data from publisher %d. Data %d", thisID, dataID)
out <- data
}
}
func workerProcess(in <-chan string) {
atomic.AddInt64(&workerID, 1)
// atomic was added after recording to fix a race condition
// discover race conditions with the -race flag
// for example: go run -race main.go
// learn about the atomic package: https://godoc.org/sync/atomic#AddInt64
thisID := atomic.LoadInt64(&workerID)
for {
fmt.Printf("%d: waiting for input...\n", thisID)
input := <-in
fmt.Printf("%d: input is: %s\n", thisID, input)
}
}
/*
CHALLENGE #1
Is this fan out?
My Answer:
Yes.
-- YES
Are we "fanning out" work? Yes. We've launched several goroutines that are simultaneously publishing a message onto our channel. The golang blog says, "Fan out means you have multiple functions reading from the same channel until that channel is closed." Here we do have multiple functions reading from the same channel. So, okay, we're fanning out.
CHALLENGE #2
Is this fan in?
No.
What is being "fanned in" here? We have launched several goroutines of the same function: workerProcess. What do those goroutines do? They are all reading from an unbuffered channel. If there was a tremendous amount of processing that each "workerProcess" func executed, then all three of the "workerProcess" funcs could be processing in parallel: pulling values off the channel and processing them. There is no "fanning in" though here. Remember what the golang blog describes fan in: "A function can read from multiple inputs and proceed until all are closed by multiplexing the input channels onto a single channel that's closed when all the inputs are closed." We don't have many channels here converging into one channel.
*/
================================================
FILE: 22_go-routines/13_channels_fan-out_fan-in/06_challenge-description/main.go
================================================
package main
import (
"fmt"
)
func main() {
in := gen()
f := factorial(in)
for n := range f {
fmt.Println(n)
}
}
func gen() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 10; i++ {
for j := 3; j < 13; j++ {
out <- j
}
}
close(out)
}()
return out
}
func factorial(in <-chan int) <-chan int {
out := make(chan int)
go func() {
for n := range in {
out <- fact(n)
}
close(out)
}()
return out
}
func fact(n int) int {
total := 1
for i := n; i > 0; i-- {
total *= i
}
return total
}
/*
CHALLENGE #1:
-- Change the code above to execute 1,000 factorial computations concurrently and in parallel.
-- Use the "fan out / fan in" pattern
CHALLENGE #2:
WATCH MY SOLUTION BEFORE DOING THIS CHALLENGE #2
-- While running the factorial computations, try to find how much of your resources are being used.
-- Post the percentage of your resources being used to this discussion: https://goo.gl/BxKnOL
*/
================================================
FILE: 22_go-routines/13_channels_fan-out_fan-in/07_challenge-solution/main.go
================================================
package main
import (
"fmt"
"sync"
)
func main() {
in := gen()
// FAN OUT
// Multiple functions reading from the same channel until that channel is closed
// Distribute work across multiple functions (ten goroutines) that all read from in.
c0 := factorial(in)
c1 := factorial(in)
c2 := factorial(in)
c3 := factorial(in)
c4 := factorial(in)
c5 := factorial(in)
c6 := factorial(in)
c7 := factorial(in)
c8 := factorial(in)
c9 := factorial(in)
// FAN IN
// multiplex multiple channels onto a single channel
// merge the channels from c0 through c9 onto a single channel
var y int
for n := range merge(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9) {
y++
fmt.Println(y, "\t", n)
}
}
func gen() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 100; i++ {
for j := 3; j < 13; j++ {
out <- j
}
}
close(out)
}()
return out
}
func factorial(in <-chan int) <-chan int {
out := make(chan int)
go func() {
for n := range in {
out <- fact(n)
}
close(out)
}()
return out
}
func fact(n int) int {
total := 1
for i := n; i > 0; i-- {
total *= i
}
return total
}
func merge(cs ...<-chan int) <-chan int {
var wg sync.WaitGroup
out := make(chan int)
output := func(c <-chan int) {
for n := range c {
out <- n
}
wg.Done()
}
wg.Add(len(cs))
for _, c := range cs {
go output(c)
}
// Start a goroutine to close out once all the output goroutines are
// done. This must start after the wg.Add call.
go func() {
wg.Wait()
close(out)
}()
return out
}
================================================
FILE: 22_go-routines/13_channels_fan-out_fan-in/08_challenge-description/main.go
================================================
package main
import (
"fmt"
"sync"
)
func main() {
in := gen()
// FAN OUT
// Multiple functions reading from the same channel until that channel is closed
// Distribute work across multiple functions (ten goroutines) that all read from in.
xc := fanOut(in, 10)
// FAN IN
// multiplex multiple channels onto a single channel
// merge the channels from c0 through c9 onto a single channel
for n := range merge(xc...) {
fmt.Println(n)
}
}
func gen() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 10; i++ {
for j := 3; j < 13; j++ {
out <- j
}
}
close(out)
}()
return out
}
func fanOut(in <-chan int, n int) []<-chan int {
xc := make([]<-chan int, n)
for i := 0; i < n; i++ {
xc = append(xc, factorial(in))
}
return xc
}
func factorial(in <-chan int) <-chan int {
out := make(chan int)
go func() {
for n := range in {
out <- fact(n)
}
close(out)
}()
return out
}
func fact(n int) int {
total := 1
for i := n; i > 0; i-- {
total *= i
}
return total
}
func merge(cs ...<-chan int) <-chan int {
var wg sync.WaitGroup
out := make(chan int)
output := func(c <-chan int) {
for n := range c {
out <- n
}
wg.Done()
}
wg.Add(len(cs))
for _, c := range cs {
go output(c)
}
// Start a goroutine to close out once all the output goroutines are
// done. This must start after the wg.Add call.
go func() {
wg.Wait()
close(out)
}()
return out
}
/*
CHALLENGE #1:
-- This code throws an error: fatal error: all goroutines are asleep - deadlock!
-- fix this code!
*/
================================================
FILE: 22_go-routines/13_channels_fan-out_fan-in/09_challenge-solution/01_troubleshooting-step/main.go
================================================
package main
import (
"fmt"
"sync"
)
func main() {
in := gen()
// FAN OUT
// Multiple functions reading from the same channel until that channel is closed
// Distribute work across multiple functions (ten goroutines) that all read from in.
xc := fanOut(in, 10)
// FAN IN
// multiplex multiple channels onto a single channel
// merge the channels from c0 through c9 onto a single channel
// TROUBLESHOOTING
fmt.Printf("%T \n", xc)
fmt.Println("*******************", len(xc))
for _, v := range xc {
fmt.Println("********", <-v)
}
for n := range merge(xc...) {
fmt.Println(n)
}
}
func gen() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 10; i++ {
for j := 3; j < 13; j++ {
out <- j
}
}
close(out)
}()
return out
}
func fanOut(in <-chan int, n int) []<-chan int {
var xc []<-chan int // this needed to be zero
for i := 0; i < n; i++ {
xc = append(xc, factorial(in))
}
return xc
}
func factorial(in <-chan int) <-chan int {
out := make(chan int)
go func() {
for n := range in {
out <- fact(n)
}
close(out)
}()
return out
}
func fact(n int) int {
total := 1
for i := n; i > 0; i-- {
total *= i
}
return total
}
func merge(cs ...<-chan int) <-chan int {
var wg sync.WaitGroup
out := make(chan int)
output := func(c <-chan int) {
for n := range c {
out <- n
}
wg.Done()
}
wg.Add(len(cs))
for _, c := range cs {
go output(c)
}
// Start a goroutine to close out once all the output goroutines are
// done. This must start after the wg.Add call.
go func() {
wg.Wait()
close(out)
}()
return out
}
================================================
FILE: 22_go-routines/13_channels_fan-out_fan-in/09_challenge-solution/02_solution/main.go
================================================
package main
import (
"fmt"
"sync"
)
func main() {
in := gen()
// FAN OUT
// Multiple functions reading from the same channel until that channel is closed
// Distribute work across multiple functions (ten goroutines) that all read from in.
xc := fanOut(in, 10)
// FAN IN
// multiplex multiple channels onto a single channel
// merge the channels from c0 through c9 onto a single channel
for n := range merge(xc...) {
fmt.Println(n)
}
}
func gen() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 10; i++ {
for j := 3; j < 13; j++ {
out <- j
}
}
close(out)
}()
return out
}
func fanOut(in <-chan int, n int) []<-chan int {
var xc []<-chan int // this needed to be zero
for i := 0; i < n; i++ {
xc = append(xc, factorial(in))
}
return xc
}
func factorial(in <-chan int) <-chan int {
out := make(chan int)
go func() {
for n := range in {
out <- fact(n)
}
close(out)
}()
return out
}
func fact(n int) int {
total := 1
for i := n; i > 0; i-- {
total *= i
}
return total
}
func merge(cs ...<-chan int) <-chan int {
var wg sync.WaitGroup
out := make(chan int)
output := func(c <-chan int) {
for n := range c {
out <- n
}
wg.Done()
}
wg.Add(len(cs))
for _, c := range cs {
go output(c)
}
// Start a goroutine to close out once all the output goroutines are
// done. This must start after the wg.Add call.
go func() {
wg.Wait()
close(out)
}()
return out
}
================================================
FILE: 22_go-routines/13_channels_fan-out_fan-in/10_van-sickle_fan-out_fan-in/main.go
================================================
package main
import (
"fmt"
)
func main() {
in := gen()
out := make(chan int)
// FAN OUT
// Multiple functions reading from the same channel until that channel is closed
// Distribute work across multiple functions (ten goroutines) that all read from in.
fanOut(in, 10, out)
// FAN IN
// multiplex multiple channels onto a single channel
// merge the channels from c0 through c9 onto a single channel
go func() {
for v := range out {
fmt.Println(v)
}
}()
var a string
fmt.Scanln(&a)
}
func gen() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 10; i++ {
for j := 3; j < 13; j++ {
out <- j
}
}
close(out)
}()
return out
}
func fanOut(in <-chan int, n int, out chan<- int) {
for i := 0; i < n; i++ {
factorial(in, out)
}
}
func factorial(in <-chan int, out chan<- int) {
go func() {
for n := range in {
out <- fact(n)
}
}()
}
func fact(n int) int {
total := 1
for i := n; i > 0; i-- {
total *= i
}
return total
}
/*
This code was provided by my friend, Mike Van Sickle
He is an awesome programmer, an awesome Go programmer, and an awesome teacher
Check out his courses on pluralsight to learn more about Go!
*/
================================================
FILE: 22_go-routines/14_incrementor-challenge/01_description/main.go
================================================
package main
import (
"fmt"
"sync"
"sync/atomic"
)
var count int64
var wg sync.WaitGroup
func main() {
wg.Add(2)
go incrementor("1")
go incrementor("2")
wg.Wait()
fmt.Println("Final Counter:", count)
}
func incrementor(s string) {
for i := 0; i < 20; i++ {
atomic.AddInt64(&count, 1)
fmt.Println("Process: "+s+" printing:", i)
}
wg.Done()
}
/*
CHALLENGE #1
-- Take the code from above and change it to use channels instead of wait groups and atomicity
*/
================================================
FILE: 22_go-routines/14_incrementor-challenge/02_solution/main.go
================================================
package main
import (
"fmt"
"strconv"
)
func main() {
c := incrementor(2)
var count int
for n := range c {
count++
fmt.Println(n)
}
fmt.Println("Final Count:", count)
}
func incrementor(n int) chan string {
c := make(chan string)
done := make(chan bool)
for i := 0; i < n; i++ {
go func(i int) {
for k := 0; k < 20; k++ {
c <- fmt.Sprint("Process: "+strconv.Itoa(i)+" printing:", k)
}
done <- true
}(i)
}
go func() {
for i := 0; i < n; i++ {
<-done
}
close(c)
}()
return c
}
================================================
FILE: 22_go-routines/15_for-fun/01/main.go
================================================
package main
import (
"fmt"
)
func main() {
m := map[int]int{}
m[4] = 7
m[3] = 87
m[72] = 19
ch := make(chan int)
// for closing ch
ch2 := make(chan int)
go func() {
var i int
for n := range ch2 {
i += n
if i == len(m) {
close(ch)
}
}
}()
go func() {
for _, v := range m {
ch <- v
ch2 <- 1
}
}()
for v := range ch {
fmt.Println(v)
}
// good housekeeping
close(ch2)
}
================================================
FILE: 22_go-routines/15_for-fun/README.md
================================================
# New Code
These files were added into this repo after the training was recorded.
There are no lectures associated with these files. However, please peruse them and enjoy them!
================================================
FILE: 23_error-handling/01_golint/01_before/main.go
================================================
package main
import "fmt"
func main() {
x := 1
str := evalInt(x)
fmt.Println(str)
}
func evalInt(n int) string {
if n > 10 {
return fmt.Sprint("x is greater than 10")
} else {
return fmt.Sprint("x is less than 10")
}
}
================================================
FILE: 23_error-handling/01_golint/02_after/main.go
================================================
package main
import "fmt"
func main() {
x := 1
str := evalInt(x)
fmt.Println(str)
}
func evalInt(n int) string {
if n > 10 {
return fmt.Sprint("x is greater than 10")
}
return fmt.Sprint("x is less than 10")
}
================================================
FILE: 23_error-handling/02_err-not-nil/01_fmt-println/main.go
================================================
package main
import (
"fmt"
"os"
)
func main() {
_, err := os.Open("no-file.txt")
if err != nil {
fmt.Println("err happened", err)
// log.Println("err happened", err)
// log.Fatalln(err)
// panic(err)
}
}
// Println formats using the default formats for its operands and writes to standard output.
================================================
FILE: 23_error-handling/02_err-not-nil/02_log-println/main.go
================================================
package main
import (
"log"
"os"
)
func main() {
_, err := os.Open("no-file.txt")
if err != nil {
// fmt.Println("err happened", err)
log.Println("err happened", err)
// log.Fatalln(err)
// panic(err)
}
}
/*
Package log implements a simple logging package ... writes to standard error and prints the date and time of each logged message ... the Fatal functions call os.Exit(1) after writing the log message ... the Panic functions call panic after writing the log message.
*/
// log.Println calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Println.
================================================
FILE: 23_error-handling/02_err-not-nil/03_log-set-output/log.txt
================================================
2016/02/17 04:35:28 err happened open no-file.txt: no such file or directory
================================================
FILE: 23_error-handling/02_err-not-nil/03_log-set-output/main.go
================================================
package main
import (
"fmt"
"log"
"os"
)
func init() {
nf, err := os.Create("log.txt")
if err != nil {
fmt.Println(err)
}
log.SetOutput(nf)
}
func main() {
_, err := os.Open("no-file.txt")
if err != nil {
// fmt.Println("err happened", err)
log.Println("err happened", err)
// log.Fatalln(err)
// panic(err)
}
}
/*
Package log implements a simple logging package ... writes to standard error and prints the date and time of each logged message ... the Fatal functions call os.Exit(1) after writing the log message ... the Panic functions call panic after writing the log message.
*/
// Println calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Println.
================================================
FILE: 23_error-handling/02_err-not-nil/04_log-fatalln/main.go
================================================
package main
import (
"log"
"os"
)
func main() {
_, err := os.Open("no-file.txt")
if err != nil {
// fmt.Println("err happened", err)
// log.Println("err happened", err)
log.Fatalln(err)
// panic(err)
}
}
/*
Package log implements a simple logging package ... writes to standard error and prints the date and time of each logged message ... the Fatal functions call os.Exit(1) after writing the log message ... the Panic functions call panic after writing the log message.
*/
// Fatalln is equivalent to Println() followed by a call to os.Exit(1).
================================================
FILE: 23_error-handling/02_err-not-nil/05_panic/main.go
================================================
package main
import (
"os"
)
func main() {
_, err := os.Open("no-file.txt")
if err != nil {
// fmt.Println("err happened", err)
// log.Println("err happened", err)
// log.Fatalln(err)
panic(err)
}
}
================================================
FILE: 23_error-handling/03_custom-errors/01_errors-new/main.go
================================================
package main
import (
"errors"
"log"
)
func main() {
_, err := Sqrt(-10)
if err != nil {
log.Fatalln(err)
}
}
func Sqrt(f float64) (float64, error) {
if f < 0 {
return 0, errors.New("norgate math: square root of negative number")
}
// implementation
return 42, nil
}
================================================
FILE: 23_error-handling/03_custom-errors/02_errors-new_var/main.go
================================================
package main
import (
"errors"
"fmt"
"log"
)
var ErrNorgateMath = errors.New("norgate math: square root of negative number")
func main() {
fmt.Printf("%T\n", ErrNorgateMath)
_, err := Sqrt(-10)
if err != nil {
log.Fatalln(err)
}
}
func Sqrt(f float64) (float64, error) {
if f < 0 {
return 0, ErrNorgateMath
}
// implementation
return 42, nil
}
// see use of errors.New in standard library:
// http://golang.org/src/pkg/bufio/bufio.go
// http://golang.org/src/pkg/io/io.go
================================================
FILE: 23_error-handling/03_custom-errors/03_fmt-errorf/main.go
================================================
package main
import (
"fmt"
"log"
)
func main() {
_, err := Sqrt(-10.23)
if err != nil {
log.Fatalln(err)
}
}
func Sqrt(f float64) (float64, error) {
if f < 0 {
return 0, fmt.Errorf("norgate math again: square root of negative number: %v", f)
}
// implementation
return 42, nil
}
================================================
FILE: 23_error-handling/03_custom-errors/04_fmt-errorf_var/main.go
================================================
package main
import (
"fmt"
"log"
)
func main() {
_, err := Sqrt(-10.23)
if err != nil {
log.Fatalln(err)
}
}
func Sqrt(f float64) (float64, error) {
if f < 0 {
ErrNorgateMath := fmt.Errorf("norgate math again: square root of negative number: %v", f)
return 0, ErrNorgateMath
}
// implementation
return 42, nil
}
================================================
FILE: 23_error-handling/03_custom-errors/05_custom-type/main.go
================================================
package main
import (
"fmt"
"log"
)
type NorgateMathError struct {
lat, long string
err error
}
func (n *NorgateMathError) Error() string {
return fmt.Sprintf("a norgate math error occured: %v %v %v", n.lat, n.long, n.err)
}
func main() {
_, err := Sqrt(-10.23)
if err != nil {
log.Println(err)
}
}
func Sqrt(f float64) (float64, error) {
if f < 0 {
nme := fmt.Errorf("norgate math redux: square root of negative number: %v", f)
return 0, &NorgateMathError{"50.2289 N", "99.4656 W", nme}
}
// implementation
return 42, nil
}
// see use of structs with error type in standard library:
// http://www.goinggo.net/2014/11/error-handling-in-go-part-ii.html
//
// http://golang.org/pkg/net/#OpError
// http://golang.org/src/pkg/net/dial.go
// http://golang.org/src/pkg/net/net.go
//
// http://golang.org/src/pkg/encoding/json/decode.go
================================================
FILE: 24_testing/math.go
================================================
package math
func Adder(xs ...int) int {
res := 0
for _, v := range xs {
res += v
}
return res
}
================================================
FILE: 24_testing/math_test.go
================================================
package math
import (
"fmt"
"testing"
"testing/quick"
)
func TestAdder(t *testing.T) {
result := Adder(4, 7)
if result != 11 {
t.Fatal("4 + 7 did not equal 11")
}
}
func BenchmarkAdder(b *testing.B) {
for i := 0; i < b.N; i++ {
Adder(4, 7)
}
}
func ExampleAdder() {
fmt.Println(Adder(4, 7))
// Output:
// 11
}
func ExampleAdder_multiple() {
fmt.Println(Adder(3, 6, 7, 4, 61))
// Output:
// 81
}
func TestAdderBlackbox(t *testing.T) {
err := quick.Check(a, nil)
if err != nil {
t.Fatal(err)
}
}
func a(x, y int) bool {
return Adder(x, y) == x+y
}
================================================
FILE: 25_code-walk/main.go
================================================
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"math/rand"
)
const (
win = 100 // The winning score in a game of Pig
gamesPerSeries = 10 // The number of games per series to simulate
)
type score struct {
player, opponent, thisTurn int
}
type action func(current score) (result score, turnIsOver bool)
func roll(s score) (score, bool) {
outcome := rand.Intn(6) + 1 // A random int in [1, 6]
if outcome == 1 {
return score{s.opponent, s.player, 0}, true
}
return score{s.player, s.opponent, outcome + s.thisTurn}, false
}
func stay(s score) (score, bool) {
return score{s.opponent, s.player + s.thisTurn, 0}, true
}
type strategy func(score) action
func stayAtK(k int) strategy {
return func(s score) action {
if s.thisTurn >= k {
return stay
}
return roll
}
}
func play(strategy0, strategy1 strategy) int {
strategies := []strategy{strategy0, strategy1}
var s score
var turnIsOver bool
currentPlayer := rand.Intn(2) // Randomly decide who plays first
for s.player+s.thisTurn < win {
action := strategies[currentPlayer](s)
s, turnIsOver = action(s)
if turnIsOver {
currentPlayer = (currentPlayer + 1) % 2
}
}
return currentPlayer
}
func roundRobin(strategies []strategy) ([]int, int) {
wins := make([]int, len(strategies))
for i := 0; i < len(strategies); i++ {
for j := i + 1; j < len(strategies); j++ {
for k := 0; k < gamesPerSeries; k++ {
winner := play(strategies[i], strategies[j])
if winner == 0 {
wins[i]++
} else {
wins[j]++
}
}
}
}
gamesPerStrategy := gamesPerSeries * (len(strategies) - 1) // no self play
return wins, gamesPerStrategy
}
func ratioString(vals ...int) string {
total := 0
for _, val := range vals {
total += val
}
s := ""
for _, val := range vals {
if s != "" {
s += ", "
}
pct := 100 * float64(val) / float64(total)
s += fmt.Sprintf("%d/%d (%0.1f%%)", val, total, pct)
}
return s
}
func main() {
strategies := make([]strategy, win)
for k := range strategies {
strategies[k] = stayAtK(k + 1)
}
wins, games := roundRobin(strategies)
for k := range strategies {
fmt.Printf("Wins, losses staying at k =% 4d: %s\n",
k+1, ratioString(wins[k], games-wins[k]))
}
}
================================================
FILE: 25_code-walk/with-comments/main.go
================================================
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"math/rand"
)
const (
win = 100 // The winning score in a game of Pig
gamesPerSeries = 10 // The number of games per series to simulate
)
// A score includes scores accumulated in previous turns for each player,
// as well as the points scored by the current player in this turn.
type score struct {
player, opponent, thisTurn int
}
// An action transitions stochastically to a resulting score.
type action func(current score) (result score, turnIsOver bool)
// roll returns the (result, turnIsOver) outcome of simulating a die roll.
// If the roll value is 1, then thisTurn score is abandoned, and the players'
// roles swap. Otherwise, the roll value is added to thisTurn.
func roll(s score) (score, bool) {
outcome := rand.Intn(6) + 1 // A random int in [1, 6]
if outcome == 1 {
return score{s.opponent, s.player, 0}, true
}
return score{s.player, s.opponent, outcome + s.thisTurn}, false
}
// stay returns the (result, turnIsOver) outcome of staying.
// thisTurn score is added to the player's score, and the players' roles swap.
func stay(s score) (score, bool) {
return score{s.opponent, s.player + s.thisTurn, 0}, true
}
// A strategy chooses an action for any given score.
type strategy func(score) action
// stayAtK returns a strategy that rolls until thisTurn is at least k, then stays.
func stayAtK(k int) strategy {
return func(s score) action {
if s.thisTurn >= k {
return stay
}
return roll
}
}
// play simulates a Pig game and returns the winner (0 or 1).
func play(strategy0, strategy1 strategy) int {
strategies := []strategy{strategy0, strategy1}
var s score
var turnIsOver bool
currentPlayer := rand.Intn(2) // Randomly decide who plays first
for s.player+s.thisTurn < win {
action := strategies[currentPlayer](s)
s, turnIsOver = action(s)
if turnIsOver {
currentPlayer = (currentPlayer + 1) % 2
}
}
return currentPlayer
}
// roundRobin simulates a series of games between every pair of strategies.
func roundRobin(strategies []strategy) ([]int, int) {
wins := make([]int, len(strategies))
for i := 0; i < len(strategies); i++ {
for j := i + 1; j < len(strategies); j++ {
for k := 0; k < gamesPerSeries; k++ {
winner := play(strategies[i], strategies[j])
if winner == 0 {
wins[i]++
} else {
wins[j]++
}
}
}
}
gamesPerStrategy := gamesPerSeries * (len(strategies) - 1) // no self play
return wins, gamesPerStrategy
}
// ratioString takes a list of integer values and returns a string that lists
// each value and its percentage of the sum of all values.
// e.g., ratios(1, 2, 3) = "1/6 (16.7%), 2/6 (33.3%), 3/6 (50.0%)"
func ratioString(vals ...int) string {
total := 0
for _, val := range vals {
total += val
}
s := ""
for _, val := range vals {
if s != "" {
s += ", "
}
pct := 100 * float64(val) / float64(total)
s += fmt.Sprintf("%d/%d (%0.1f%%)", val, total, pct)
}
return s
}
func main() {
strategies := make([]strategy, win)
for k := range strategies {
strategies[k] = stayAtK(k + 1)
}
wins, games := roundRobin(strategies)
for k := range strategies {
fmt.Printf("Wins, losses staying at k =% 4d: %s\n",
k+1, ratioString(wins[k], games-wins[k]))
}
}
================================================
FILE: 26_QUESTIONS-FROM-STUDENTS/01-package-scope/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(x)
}
================================================
FILE: 26_QUESTIONS-FROM-STUDENTS/01-package-scope/variables.go
================================================
package main
var x = 7
================================================
FILE: 26_QUESTIONS-FROM-STUDENTS/02-goroutines-printing/main.go
================================================
package main
import "fmt"
func main() {
c := make(chan int)
go func() {
for i := 0; i < 10; i++ {
fmt.Println("In goroutine:", i)
c <- i
}
close(c)
}()
for n := range c {
fmt.Println("In main: ", n)
}
}
================================================
FILE: 26_QUESTIONS-FROM-STUDENTS/03-range-chan/main.go
================================================
package main
import (
"fmt"
"sync"
)
func main() {
in := gen()
// FAN OUT
// Multiple functions reading from the same channel until that channel is closed
// Distribute work across multiple functions (ten goroutines) that all read from in.
c0 := factorial(in)
c1 := factorial(in)
c2 := factorial(in)
c3 := factorial(in)
c4 := factorial(in)
c5 := factorial(in)
c6 := factorial(in)
c7 := factorial(in)
c8 := factorial(in)
c9 := factorial(in)
// FAN IN
// multiplex multiple channels onto a single channel
// merge the channels from c0 through c9 onto a single channel
var y int
for n := range merge(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9) {
y++
fmt.Println(y, "\t", n)
}
}
func gen() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 100; i++ {
for j := 3; j < 13; j++ {
out <- j
}
}
close(out)
}()
return out
}
func factorial(in <-chan int) <-chan int {
out := make(chan int)
go func() {
for n := range in {
out <- fact(n)
}
close(out)
}()
return out
}
func fact(n int) int {
total := 1
for i := n; i > 0; i-- {
total *= i
}
return total
}
func merge(cs ...<-chan int) <-chan int {
var wg sync.WaitGroup
out := make(chan int)
output := func(c <-chan int) {
for n := range c {
out <- n
}
wg.Done()
}
wg.Add(len(cs))
for _, c := range cs {
go output(c)
}
// Start a goroutine to close out once all the output goroutines are
// done. This must start after the wg.Add call.
go func() {
wg.Wait()
close(out)
}()
return out
}
================================================
FILE: 26_QUESTIONS-FROM-STUDENTS/04_goroutines_closing-chan/01_broken-code/main.go
================================================
package main
import "fmt"
// THIS CODE DOES NOT RUN
// see next folder for fixed code with notes
var done chan bool
func main() {
done = make(chan bool)
c := fanIn(incrementor("1"), incrementor("2"))
for n := range c {
fmt.Println(n)
}
}
func incrementor(s string) <-chan string {
c := make(chan string)
go func() {
for i := 0; i < 20; i++ {
c <- fmt.Sprintf("Process: "+s+" printing:", i)
}
done <- true
}()
return c
}
// FAN IN
func fanIn(input1, input2 <-chan string) <-chan string {
c := make(chan string)
go func() {
for {
c <- <-input1
}
}()
go func() {
for {
c <- <-input2
}
}()
go func() {
<-done
<-done
close(c)
}()
return c
}
================================================
FILE: 26_QUESTIONS-FROM-STUDENTS/04_goroutines_closing-chan/02_fixed-code/main.go
================================================
package main
import (
"fmt"
)
func main() {
// read NOTE ONE below
c1 := incrementor("1")
c2 := incrementor("2")
// NOTE TWO
// the flow of code continues here in main
// incrementor is called
// launches goroutines
// returns channels which will eventually be closed
// by the code that is running in the goroutines
// launched by incrementor
// program flow in main continues on down vertically here
// NOTE THREE
// you're passing into "fanIn" two channels
// fanIn HAS TO pull values off of those channels
// otherwise: DEADLOCK
// fanIn will need to launch goroutines to pull those values
c := fanIn(c1, c2)
// NOTE SEVEN
// we are held up here
// pulling values off of c
// until c is closed
// and all values have been pulled from c
// at which point ...
for n := range c {
fmt.Println(n)
}
// NOTE EIGHT
// our program is done
// flow of code exits out of main
// program ends
}
func incrementor(s string) <-chan string {
c := make(chan string)
go func() {
for i := 0; i < 20; i++ {
// NOTE NINE
// use Sprint here, or Sprintln, not Sprintf
// this code is formatted for Sprintln
// Sprintf would need this
// c <- fmt.Sprintf("Process: %v, printing %v", s, i)
c <- fmt.Sprint("Process: "+s+" printing:", i)
}
// NOTE ONE
// incrementor
// every time it's called
// create a channel, put values on the channel
// ******** important ********
// have some other goroutine somewhere
// pulling values off the channel
// ***************************
// close the channel
// return that closed channel
// these "incrementor" goroutines are off and running
close(c)
}()
return c
}
// FAN IN
func fanIn(input1, input2 <-chan string) <-chan string {
c := make(chan string)
done := make(chan bool)
// NOTE FOUR
// these goroutines will pull values off the "incrementor" channels
// I'm defining the func to have a channel as a parameter and
// I'm passing the channels in as an argument
// as this is good practice to avoid different channels
// accessing the same data and creating a race condition
// not needed here, but good practice
// and good to know about
go func(x <-chan string) {
for n := range x {
c <- n
}
done <- true
}(input1)
go func(x <-chan string) {
for n := range x {
c <- n
}
done <- true
}(input2)
// NOTE FIVE
// this will signal when we're done writing values to c
go func() {
<-done
<-done
close(c)
}()
// NOTE SIX
// all of the above code
// just flows straight through
// goroutines are launched
// and even though they're not done processing
// program flow comes to here and this func returns
// the channel c
return c
}
================================================
FILE: 26_QUESTIONS-FROM-STUDENTS/05_concurrency-channels/main.go
================================================
package main
import "fmt"
func main() {
n := 10
c := make(chan int)
done := make(chan bool)
go func() {
for i := 0; i < 1000; i++ {
c <- i
}
close(c)
}()
for i := 0; i < n; i++ {
go func(x int) {
for q := range c {
fmt.Println("i", x, "q", q)
}
done <- true
}(i)
}
for i := 0; i < n; i++ {
<-done
}
}
================================================
FILE: 26_QUESTIONS-FROM-STUDENTS/06_performance-ramifications/01_called/main.go
================================================
package main
import (
"fmt"
"time"
)
func main() {
start := time.Now()
in := gen()
f := factorial(in)
for n := range f {
fmt.Println(n)
}
fmt.Println(time.Since(start))
}
func gen() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 10; i++ {
for j := 3; j < 13; j++ {
out <- j
}
}
close(out)
}()
return out
}
func factorial(in <-chan int) <-chan int {
out := make(chan int)
go func() {
for n := range in {
out <- fact(n)
}
close(out)
}()
return out
}
func fact(n int) int {
total := 1
for i := n; i > 0; i-- {
total *= i
}
return total
}
================================================
FILE: 26_QUESTIONS-FROM-STUDENTS/06_performance-ramifications/02_not-called/main.go
================================================
package main
import (
"fmt"
"time"
)
func main() {
start := time.Now()
in := gen()
f := factorial(in)
for n := range f {
fmt.Println(n)
}
fmt.Println(time.Since(start))
}
func gen() <-chan int {
out := make(chan int)
go func() {
for i := 0; i < 10; i++ {
for j := 3; j < 13; j++ {
out <- j
}
}
close(out)
}()
return out
}
func factorial(in <-chan int) <-chan int {
out := make(chan int)
go func() {
for n := range in {
total := 1
for i := n; i > 0; i-- {
total *= i
}
out <- total
}
close(out)
}()
return out
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/01_division/01_int-int/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(32 / 16)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/01_division/02_int-float/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(32 / 3.74)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/01_division/03_var_int-float/main.go
================================================
package main
import "fmt"
func main() {
answer := 32 / 3.74
fmt.Println(answer)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/01_division/04_var_int-float_invalid-code/main.go
================================================
package main
import "fmt"
func main() {
var answer int
answer = 32 / 3.74
fmt.Println(answer)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/01_escape-sequences/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println("Hello\tWorld\nHow are you?")
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/02_sequence-of-bytes/main.go
================================================
package main
import "fmt"
func main() {
intro := "Four score and seven years ago...."
fmt.Println(intro)
fmt.Println([]byte(intro)) // sequence of bytes
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/03_immutable/main.go
================================================
package main
import "fmt"
func main() {
intro := "Four score and seven years ago...."
fmt.Println(intro)
fmt.Println(&intro)
intro = "Hahahaha!"
fmt.Println(intro)
fmt.Println(&intro)
// the below is invalid
// intro[0] = 70
// fmt.Println(intro)
// fmt.Println(&intro)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/04_len/01_len-english/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(len("hello"))
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/04_len/02_len-chinese/main.go
================================================
package main
import "fmt"
func main() {
fmt.Println(len("世界"))
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/04_len/03_binary/main.go
================================================
package main
import "fmt"
func main() {
intro := "Four 世"
fmt.Printf("%T\n", intro)
fmt.Println(intro)
bs := []byte(intro)
fmt.Println(bs)
fmt.Printf("%T\n", bs)
fmt.Println("*********")
fmt.Printf("%d\n", bs)
for _, v := range bs {
fmt.Printf("%d\t\t %#x\t %b\n", v, v, v)
}
fmt.Println("*********")
y := 9999999999999999
fmt.Printf("%d\t\t %#x\t %b\n", y, y, y)
fmt.Println(&y)
fmt.Sprint(y)
fmt.Println("*********")
z := 'h'
fmt.Printf("%T\n", z)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/05_index-access/main.go
================================================
package main
import "fmt"
func main() {
greeting := "Hello"
fmt.Println(greeting)
fmt.Println(greeting[0])
fmt.Println(greeting[4])
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/06_slicing/01/main.go
================================================
package main
import "fmt"
func main() {
greeting := "Hello"
fmt.Println(greeting)
fmt.Println(greeting[0])
fmt.Println(greeting[4])
fmt.Println("-------------")
fmt.Println("What the ... ")
fmt.Println(greeting[:4])
fmt.Println("... did that just do?")
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/06_slicing/02/main.go
================================================
package main
import "fmt"
func main() {
greeting := "Hello"
fmt.Println(greeting)
fmt.Println(greeting[:4])
fmt.Println(greeting[0:4])
fmt.Println(greeting[1:4])
fmt.Println(greeting[1:])
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/06_slicing/03_invalid_negative-index/main.go
================================================
package main
import "fmt"
func main() {
greeting := "Hello"
fmt.Println(greeting)
fmt.Println(greeting[:4])
fmt.Println(greeting[0:4])
fmt.Println(greeting[1:4])
fmt.Println(greeting[1:])
fmt.Println(greeting[:-2]) // invalid
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/07_concatenation/main.go
================================================
package main
import "fmt"
func main() {
fname := "James"
lname := "Bond"
fmt.Println(fname + " " + lname)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/03_strconv/01_itoa/main.go
================================================
package main
import (
"fmt"
"strconv"
)
func main() {
var x int = 5
str := "Hello world " + strconv.Itoa(x) // int to ascii
fmt.Println(str)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/03_strconv/02_fmt-sprint/main.go
================================================
package main
import "fmt"
func main() {
var x int = 5
str := "Hello world " + fmt.Sprint(x)
fmt.Println(str)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/03_strconv/03_atoi/main.go
================================================
package main
import (
"fmt"
"strconv"
)
func main() {
i, _ := strconv.Atoi("32")
fmt.Println(i + 10)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/06_math-pkg/main.go
================================================
package main
import (
"fmt"
"math"
)
func main() {
up := 34.705945
down := 34.405945
fmt.Println(math.Floor(up + 0.5))
fmt.Println(math.Floor(down + 0.5))
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/07_typeOf/01_better-code/main.go
================================================
package main
import (
"fmt"
"reflect"
)
func main() {
a := "this is stored in the variable a"
b := 42
c, d, e, f := 44.7, true, false, 'm' // single quotes
g := "g" // double quotes
h := `h` // back ticks
fmt.Println("a - ", reflect.TypeOf(a), " - ", a)
fmt.Println("b - ", reflect.TypeOf(b), " - ", b)
fmt.Println("c - ", reflect.TypeOf(c), " - ", c)
fmt.Println("d - ", reflect.TypeOf(d), " - ", d)
fmt.Println("e - ", reflect.TypeOf(e), " - ", e)
fmt.Println("f - ", reflect.TypeOf(f), " - ", f)
fmt.Println("g - ", reflect.TypeOf(g), " - ", g)
fmt.Println("h - ", reflect.TypeOf(h), " - ", h)
fmt.Printf("h - %T\n", h)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/00_types/07_typeOf/02_worse-code/main.go
================================================
package main
import (
"fmt"
"reflect"
)
var a string = "this is stored in the variable a" // package scope
var b, c string = "stored in b", "stored in c" // package scope
var d string // package scope
func main() {
d = "stored in d" // declaration above; assignment here; package scope
var e int = 42 // function scope - subsequent variables have same package scope:
f := 43
g := "stored in g"
h, i := "stored in h", "stored in i"
j, k, l, m := 44.7, true, false, 'm' // single quotes
n := "n" // double quotes
o := `o` // back ticks
fmt.Println("a - ", reflect.TypeOf(a), " - ", a)
fmt.Println("b - ", reflect.TypeOf(b), " - ", b)
fmt.Println("c - ", reflect.TypeOf(c), " - ", c)
fmt.Println("d - ", reflect.TypeOf(d), " - ", d)
fmt.Println("e - ", reflect.TypeOf(e), " - ", e)
fmt.Println("f - ", reflect.TypeOf(f), " - ", f)
fmt.Println("g - ", reflect.TypeOf(g), " - ", g)
fmt.Println("h - ", reflect.TypeOf(h), " - ", h)
fmt.Println("i - ", reflect.TypeOf(i), " - ", i)
fmt.Println("j - ", reflect.TypeOf(j), " - ", j)
fmt.Println("k - ", reflect.TypeOf(k), " - ", k)
fmt.Println("l - ", reflect.TypeOf(l), " - ", l)
fmt.Println("m - ", reflect.TypeOf(m), " - ", m)
fmt.Println("n - ", reflect.TypeOf(n), " - ", n)
fmt.Println("o - ", reflect.TypeOf(o), " - ", o)
fmt.Printf("o - %T\n", o)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/01_struct/main.go
================================================
package main
import "fmt"
type person struct {
name string
age int
}
func main() {
p1 := person{"James", 20}
fmt.Println(p1)
fmt.Println(p1.name)
fmt.Println(p1.age)
fmt.Printf("%T\n", p1)
}
// we've already seen the above code
================================================
FILE: 27_code-in-process/26_playing-with-type/02_string/main.go
================================================
package main
import "fmt"
type mySentence string
func main() {
var message mySentence = "Hello World!"
fmt.Println(message)
fmt.Printf("%T\n", message)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/03_string-conversion/main.go
================================================
package main
import "fmt"
type mySentence string
func main() {
var message mySentence = "Hello World!"
fmt.Println(message)
fmt.Printf("%T\n", message)
fmt.Printf("%T\n", string(message))
}
================================================
FILE: 27_code-in-process/26_playing-with-type/04_string_assertion_invalid-code/main.go
================================================
package main
import "fmt"
type mySentence string
func main() {
var message mySentence = "Hello World!"
fmt.Println(message)
fmt.Printf("%T\n", message)
fmt.Printf("%T\n", message.(string))
}
================================================
FILE: 27_code-in-process/26_playing-with-type/05_var-for-zero-val-initalization/main.go
================================================
package main
import "fmt"
type person struct {
name string
age int
}
func main() {
var p1 person
fmt.Println(p1)
fmt.Println(p1.name)
fmt.Println(p1.age)
fmt.Printf("%T\n", p1)
}
// always use var to create and
// initialize a variable to its zero value
================================================
FILE: 27_code-in-process/26_playing-with-type/06_shorthand-notation_nonzero-initalization/main.go
================================================
package main
import "fmt"
type person struct {
name string
age int
}
func main() {
p1 := person{
name: "James",
age: 20,
}
fmt.Println(p1)
fmt.Println(p1.name)
fmt.Println(p1.age)
fmt.Printf("%T\n", p1)
}
// always use shorthand notation to
// create and initialize a variable to values
================================================
FILE: 27_code-in-process/26_playing-with-type/xx05_slice-strings/main.go
================================================
package main
import "fmt"
type mySentences []string
func main() {
var messages mySentences = []string{"Hello World!", "More coffee"}
fmt.Println(messages)
fmt.Printf("%T\n", messages)
}
================================================
FILE: 27_code-in-process/26_playing-with-type/xx06_slice-strings_conversion/main.go
================================================
package main
import "fmt"
type mySentences []string
func main() {
var messages mySentences = []string{"Hello World!", "More coffee"}
fmt.Println(messages)
fmt.Printf("%T\n", messages)
fmt.Printf("%T\n", []string(messages))
}
================================================
FILE: 27_code-in-process/26_playing-with-type/xx07_int/main.go
================================================
package main
import "fmt"
type myType int
func main() {
var x myType = 32
fmt.Println(x)
fmt.Printf("%T\n", x)
fmt.Printf("%T\n", int(x))
}
================================================
FILE: 27_code-in-process/26_playing-with-type/xx08_slice-ints/main.go
================================================
package main
import "fmt"
type myType []int
func main() {
var x myType = []int{32, 44, 57}
fmt.Println(x)
fmt.Printf("%T\n", x)
fmt.Printf("%T\n", []int(x))
}
================================================
FILE: 27_code-in-process/27_package-os/00_args/main.go
================================================
package main
import (
"fmt"
"os"
)
func main() {
entry := os.Args[1]
fmt.Println(entry)
}
/*
step 1:
go install
step 2 - from terminal:
programName arguments
*/
================================================
FILE: 27_code-in-process/27_package-os/01_Read/01/dst.txt
================================================
ABCDE
================================================
FILE: 27_code-in-process/27_package-os/01_Read/01/main.go
================================================
package main
import (
"os"
)
func main() {
src, err := os.Open("src.txt")
if err != nil {
panic(err)
}
defer src.Close()
dst, err := os.Create("dst.txt")
if err != nil {
panic(err)
}
defer dst.Close()
bs := make([]byte, 5)
src.Read(bs)
dst.Write(bs)
}
// this is a limit reader
// we limit what is read
// see io.ReadFull for func similiar to (*File)Read
================================================
FILE: 27_code-in-process/27_package-os/01_Read/01/src.txt
================================================
ABCDEFGHIJKLMNOPQRSTUVWXYZ
================================================
FILE: 27_code-in-process/27_package-os/02_Write/01/main.go
================================================
package main
import (
"log"
"os"
)
func main() {
dst, err := os.Create(os.Args[1])
if err != nil {
log.Fatalf("error creating destination file:%v ", err)
}
defer dst.Close()
dst.Write([]byte("Hello World"))
}
/*
os.Create
func Create(name string) (*File, error)
os
func (f *File) Write(b []byte) (n int, err error)
os
func (f *File) Read(b []byte) (n int, err error)
*/
/*
step 1 - at command line enter:
go install
step 2 - at command line enter:
programName initial.txt second.txt
*/
================================================
FILE: 27_code-in-process/27_package-os/02_Write/02/hello.txt
================================================
Put some phrase here.
================================================
FILE: 27_code-in-process/27_package-os/02_Write/02/main.go
================================================
package main
import (
"log"
"os"
)
func main() {
dst, err := os.Create("hello.txt")
if err != nil {
log.Fatalln("error creating destination file: ", err.Error())
}
defer dst.Close()
bs := []byte("Put some phrase here.")
_, err = dst.Write(bs)
if err != nil {
log.Fatalln("error writing to file: ", err.Error())
}
}
================================================
FILE: 27_code-in-process/27_package-os/02_Write/03_absolute-path/main.go
================================================
package main
import (
"log"
"os"
)
func main() {
dst, err := os.Create("/tmp/hello.txt")
if err != nil {
log.Fatalln("error creating destination file: ", err.Error())
}
defer dst.Close()
bs := []byte("Put some phrase here.")
_, err = dst.Write(bs)
if err != nil {
log.Fatalln("error writing to file: ", err.Error())
}
}
================================================
FILE: 27_code-in-process/27_package-os/03_mkdir/01/main.go
================================================
package main
import (
"log"
"os"
)
func main() {
err := os.Mkdir("/somefolderthatdoesntexist", 0x777)
if err != nil {
log.Fatalln("my program broke on mkdir: ", err.Error())
}
f, err := os.Create("/somefolderthatdoesntexist/hello.txt")
if err != nil {
log.Fatalln("my program broke", err.Error())
}
defer f.Close()
str := "Put some phrase here."
bs := []byte(str)
_, err = f.Write(bs)
if err != nil {
log.Fatalln("error writing to file: ", err.Error())
}
}
/*
step 1 - at command line enter:
go install
step 2 - at command line enter:
sudo 05_mkdir_write-file_absolute-path
--- or ---
step 1 - at command line enter:
sudo go run main.go
---------
use at command line to see folder:
ls /somefolderthatdoesntexist
use at command line to remove folder:
rm -rf /somefolderthatdoesntexist
*/
================================================
FILE: 27_code-in-process/27_package-os/03_mkdir/02/main.go
================================================
package main
import (
"log"
"os"
)
func main() {
// using os.ModePerm instead of 0x777
err := os.Mkdir("/somefolderthatdoesntexist", os.ModePerm)
if err != nil {
log.Fatalln("my program broke on mkdir: ", err.Error())
}
f, err := os.Create("/somefolderthatdoesntexist/hello.txt")
if err != nil {
log.Fatalln("my program broke", err.Error())
}
defer f.Close()
str := "Put some phrase here."
bs := []byte(str)
_, err = f.Write(bs)
if err != nil {
log.Fatalln("error writing to file: ", err.Error())
}
}
/*
step 1 - at command line enter:
go install
step 2 - at command line enter:
sudo 05_mkdir_write-file_absolute-path
--- or ---
step 1 - at command line enter:
sudo go run main.go
---------
use at command line to see folder:
ls /somefolderthatdoesntexist
use at command line to remove folder:
rm -rf /somefolderthatdoesntexist
*/
================================================
FILE: 27_code-in-process/27_package-os/04_FileMode/01/main.go
================================================
package main
import (
"fmt"
"os"
)
func main() {
fmt.Println(os.ModeDir)
fmt.Printf("%p\n", os.ModeDir)
fmt.Printf("%d\n", os.ModeDir)
fmt.Println(os.ModeAppend)
fmt.Println(os.ModeExclusive)
fmt.Println(os.ModeTemporary)
fmt.Println(os.ModeSymlink)
fmt.Println(os.ModeDevice)
fmt.Println(os.ModeNamedPipe)
fmt.Println(os.ModeSocket)
fmt.Println(os.ModeSetuid)
fmt.Println(os.ModeSetgid)
fmt.Println(os.ModeCharDevice)
fmt.Println(os.ModeSticky)
fmt.Println(os.ModeType)
fmt.Println(os.ModePerm)
}
================================================
FILE: 27_code-in-process/27_package-os/04_FileMode/02/
gitextract_hr2xhgpb/ ├── .gitignore ├── 01_getting-started/ │ ├── 01_helloWorld/ │ │ └── main.go │ ├── 02_numeral-systems/ │ │ ├── 01_decimal/ │ │ │ └── main.go │ │ ├── 02_binary/ │ │ │ └── main.go │ │ ├── 03_hexadecimal/ │ │ │ └── main.go │ │ └── 04_loop/ │ │ └── main.go │ └── 03_UTF-8/ │ └── main.go ├── 02_package/ │ ├── icomefromalaska/ │ │ └── name2.go │ ├── main/ │ │ └── main.go │ └── stringutil/ │ ├── name.go │ ├── reverse.go │ └── reverseTwo.go ├── 03_variables/ │ ├── 01_shorthand/ │ │ ├── 01/ │ │ │ └── main.go │ │ └── 02/ │ │ └── main.go │ ├── 02_var_zero-value/ │ │ └── main.go │ └── 03_less-emphasis/ │ ├── 01_declare-variable/ │ │ └── var.go │ ├── 02_declare-many-at-once/ │ │ └── var.go │ ├── 03_init-many-at-once/ │ │ └── var.go │ ├── 04_infer-type/ │ │ └── var.go │ ├── 05_infer-mixed-up-types/ │ │ └── var.go │ ├── 06_init-shorthand/ │ │ └── var.go │ ├── 07_all-together/ │ │ └── variables.go │ └── 08_exercise_your-name/ │ ├── 01_oneSolution/ │ │ └── myNameVar.go │ ├── 02_anotherSolution/ │ │ └── myNameVar.go │ ├── 03_anotherSolution/ │ │ └── myNameVar.go │ └── 04_anotherSolution/ │ └── myNameVar.go ├── 04_scope/ │ ├── 01_package-scope/ │ │ ├── 01/ │ │ │ └── main.go │ │ └── 02_visibility/ │ │ ├── main/ │ │ │ └── main.go │ │ └── vis/ │ │ ├── name.go │ │ └── printer.go │ ├── 02_block-scope/ │ │ ├── 01_this-does-not-compile/ │ │ │ └── main.go │ │ └── 02_closure/ │ │ ├── 01/ │ │ │ └── main.go │ │ ├── 02/ │ │ │ └── main.go │ │ ├── 03/ │ │ │ └── main.go │ │ └── 04/ │ │ └── main.go │ ├── 03_order-matters/ │ │ └── main.go │ ├── 04_variable-shadowing/ │ │ └── main.go │ └── 05_same-package/ │ ├── main.go │ └── same.go ├── 05_blank-identifier/ │ ├── 01_invalid-code/ │ │ └── main.go │ └── 02_http-get_example/ │ ├── 01_with-error-checking/ │ │ └── main.go │ └── 02_no-error-checking/ │ └── main.go ├── 06_constants/ │ ├── 01_constant/ │ │ └── main.go │ ├── 02_multiple-initialization/ │ │ └── main.go │ ├── 03_iota/ │ │ └── main.go │ ├── 04_iota/ │ │ └── main.go │ ├── 05_iota/ │ │ └── main.go │ ├── 06_iota/ │ │ └── main.go │ └── 07_iota/ │ └── main.go ├── 07_memory-address/ │ ├── 01_showing-address/ │ │ └── main.go │ └── 02_using-address/ │ └── main.go ├── 08_pointers/ │ ├── 01_referencing/ │ │ └── main.go │ ├── 02_dereferencing/ │ │ └── main.go │ ├── 03_using-pointers/ │ │ └── main.go │ └── 04_using-pointers/ │ ├── 01_no-pointer/ │ │ ├── 01/ │ │ │ └── main.go │ │ └── 02_see-the-addresses/ │ │ └── main.go │ └── 02_pointer/ │ ├── 01/ │ │ └── main.go │ └── 02_see-the-addresses/ │ └── main.go ├── 09_remainder/ │ └── main.go ├── 10_for-loop/ │ ├── 01_init-condition-post/ │ │ └── main.go │ ├── 02_nested/ │ │ └── main.go │ ├── 03_for-condition-while-ish/ │ │ └── main.go │ ├── 04_for_no-condition/ │ │ └── main.go │ ├── 05_for_break/ │ │ └── main.go │ ├── 06_for_continue/ │ │ └── main.go │ └── 07_rune-loop_UTF8/ │ ├── 01/ │ │ └── main.go │ └── 02/ │ └── main.go ├── 11_switch-statements/ │ ├── 01_switch/ │ │ └── main.go │ ├── 02_fallthrough/ │ │ └── main.go │ ├── 03_multiple-evals/ │ │ └── main.go │ ├── 04_no-expression/ │ │ └── main.go │ └── 05_on-type/ │ └── type.go ├── 12_if_else-if_else/ │ ├── 01_eval-true/ │ │ └── main.go │ ├── 02_not-exclamation/ │ │ └── main.go │ ├── 03_init-statement/ │ │ └── main.go │ ├── 04_init-statement_error_invalid-code/ │ │ └── main.go │ ├── 05_if-else/ │ │ └── main.go │ ├── 06_if-elseif-else/ │ │ └── main.go │ ├── 07_if-elseif-elseif-else/ │ │ └── main.go │ └── 08_divisibleByThree/ │ └── main.go ├── 13_exercise-solutions/ │ ├── 01_hello-world/ │ │ └── main.go │ ├── 02_hello-NAME/ │ │ └── main.go │ ├── 03_hello-user-input/ │ │ └── main.go │ ├── 04_user-enters-numbers/ │ │ └── main.go │ ├── 05_even-numbers/ │ │ └── main.go │ ├── 06_fizzBuzz/ │ │ └── main.go │ ├── 07_threeFive/ │ │ └── main.go │ └── 08_just-fyi/ │ ├── 01_benchMark/ │ │ └── bm_test.go │ ├── 02_benchMark/ │ │ └── bm_test.go │ └── 03_utf/ │ └── main.go ├── 14_functions/ │ ├── 01_main/ │ │ └── main.go │ ├── 02_param-arg/ │ │ └── main.go │ ├── 03_two-params/ │ │ ├── 01/ │ │ │ └── main.go │ │ └── 02/ │ │ └── main.go │ ├── 04_return/ │ │ └── main.go │ ├── 05_return-naming/ │ │ └── main.go │ ├── 06_return-multiple/ │ │ └── main.go │ ├── 07_variadic-params/ │ │ └── main.go │ ├── 08_variadic-args/ │ │ └── main.go │ ├── 09_slice-param-arg/ │ │ └── main.go │ ├── 10_func-expression/ │ │ ├── 01_before-func-expression/ │ │ │ └── main.go │ │ ├── 02_func-expression/ │ │ │ └── main.go │ │ ├── 03_func-expression_shows-type/ │ │ │ └── main.go │ │ ├── 04_another-way_func-expression/ │ │ │ └── main.go │ │ └── 05_another-way_func-expression_shows-type/ │ │ └── main.go │ ├── 11_closure/ │ │ ├── 01/ │ │ │ └── main.go │ │ ├── 02/ │ │ │ └── main.go │ │ ├── 03/ │ │ │ └── main.go │ │ ├── 04/ │ │ │ └── main.go │ │ └── 05/ │ │ └── main.go │ ├── 12_callbacks/ │ │ ├── 01_print-nums/ │ │ │ └── main.go │ │ └── 02_filter-nums/ │ │ └── main.go │ ├── 13_recursion/ │ │ └── main.go │ ├── 14_defer/ │ │ ├── 01_no-defer/ │ │ │ └── main.go │ │ └── 02_with-defer/ │ │ └── main.go │ ├── 15_passing-by-value/ │ │ ├── 01_int/ │ │ │ └── main.go │ │ ├── 02_int-pointer/ │ │ │ └── main.go │ │ ├── 03_string/ │ │ │ └── main.go │ │ ├── 04_string-pointer/ │ │ │ └── main.go │ │ ├── 05_REFERENCE-TYPE/ │ │ │ └── main.go │ │ ├── 06_REFERENCE-TYPE/ │ │ │ └── main.go │ │ └── 07_struct-pointer/ │ │ └── main.go │ └── 16_anon_self-executing/ │ └── main.go ├── 15_bool-expressions/ │ ├── 01_true-false/ │ │ └── main.go │ ├── 02_not/ │ │ └── main.go │ ├── 03_or/ │ │ └── main.go │ └── 04_and/ │ └── main.go ├── 16_exercise-solutions/ │ ├── 01_half/ │ │ ├── 01/ │ │ │ └── main.go │ │ └── 02/ │ │ └── main.go │ ├── 02_func-expression/ │ │ └── main.go │ ├── 03_variadic-greatest/ │ │ └── main.go │ ├── 04_bool-expression/ │ │ └── main.go │ └── 05_params-and-args/ │ └── main.go ├── 17_array/ │ ├── 01/ │ │ └── main.go │ ├── 02/ │ │ └── main.go │ ├── 03/ │ │ └── main.go │ ├── 04/ │ │ └── main.go │ └── 05/ │ └── main.go ├── 18_slice/ │ ├── 01_int-slice/ │ │ └── main.go │ ├── 02_int-slice/ │ │ └── main.go │ ├── 03_int-slice/ │ │ └── main.go │ ├── 04_string-slice/ │ │ └── main.go │ ├── 05_slicing-a-slice/ │ │ ├── 01/ │ │ │ └── main.go │ │ └── 02/ │ │ └── main.go │ ├── 06_make/ │ │ └── main.go │ ├── 07_append-invalid/ │ │ └── main.go │ ├── 08_append/ │ │ └── main.go │ ├── 09_append-beyond-capacity/ │ │ └── main.go │ ├── 10_append_slice-to-slice/ │ │ ├── 01_slice-of-ints/ │ │ │ └── main.go │ │ └── 02_slice-of-strings/ │ │ └── main.go │ ├── 11_delete/ │ │ └── main.go │ ├── 12_multi-dimensional/ │ │ ├── 01_shorthand-slice/ │ │ │ └── main.go │ │ ├── 02_var-slice/ │ │ │ └── main.go │ │ ├── 03_make-slice/ │ │ │ └── main.go │ │ ├── 04_comparing_shorthand_var_make/ │ │ │ ├── 01_shorthand-slice/ │ │ │ │ └── main.go │ │ │ ├── 02_var-slice/ │ │ │ │ └── main.go │ │ │ └── 03_make-slice/ │ │ │ └── main.go │ │ ├── 05_slice-of-slice-of-string/ │ │ │ └── main.go │ │ └── 06_slice-of-slice-of-int/ │ │ └── main.go │ └── 13_int-slice-plus-plus/ │ └── main.go ├── 19_map/ │ ├── 01_var_nil-map/ │ │ └── main.go │ ├── 02_var_make/ │ │ └── main.go │ ├── 03_shorthand_make/ │ │ └── main.go │ ├── 04_shorthand_composite-literal/ │ │ └── main.go │ ├── 05_shorthand_composite-literal/ │ │ └── main.go │ ├── 06_adding-entry/ │ │ └── main.go │ ├── 07_len/ │ │ └── main.go │ ├── 08_updating-entry/ │ │ └── main.go │ ├── 09_deleting-entry/ │ │ └── main.go │ ├── 10_comma-ok-idiom_val-exists/ │ │ └── main.go │ ├── 11_deleting-entry_no-error/ │ │ └── main.go │ ├── 12_comma-ok-idiom_val-not-exists/ │ │ └── main.go │ ├── 13_loop-range/ │ │ └── main.go │ └── 14_hash-table/ │ ├── 01_letter-buckets/ │ │ ├── 01_runes-are-numbers/ │ │ │ └── main.go │ │ ├── 02_strings-to-rune-conversion/ │ │ │ └── main.go │ │ ├── 03_string-index-access/ │ │ │ └── main.go │ │ ├── 04_remainder-bucket-selection/ │ │ │ └── main.go │ │ ├── 05_hash-function/ │ │ │ └── main.go │ │ ├── 06_get/ │ │ │ └── main.go │ │ ├── 07_scanner/ │ │ │ └── main.go │ │ ├── 08_moby-dicks-words/ │ │ │ └── main.go │ │ ├── 09_int-slice-plus-plus/ │ │ │ └── main.go │ │ ├── 10_hash-letter-buckets/ │ │ │ └── main.go │ │ └── 11_hash-remainder-buckets/ │ │ └── main.go │ ├── 02_even-dstribution-hash/ │ │ └── main.go │ ├── 03_words-in-buckets/ │ │ ├── 01_slice-bucket/ │ │ │ └── main.go │ │ └── 02_map-bucket/ │ │ └── main.go │ └── 04_english-alphabet/ │ ├── 01/ │ │ └── main.go │ └── 02/ │ └── main.go ├── 20_struct/ │ ├── 00_object-oriented/ │ │ └── notes.txt │ ├── 01_user-defined-types/ │ │ ├── 01_alias-type_not-idiomatic/ │ │ │ └── main.go │ │ ├── 02_static-typing/ │ │ │ └── main.go │ │ └── notes.txt │ ├── 02_struct_fields_values_initialization/ │ │ ├── main.go │ │ └── notes.txt │ ├── 03_methods/ │ │ ├── main.go │ │ └── notes.txt │ ├── 04_embedded-types/ │ │ └── main.go │ ├── 05_promotion/ │ │ ├── 01_overriding-fields/ │ │ │ └── main.go │ │ └── 02_overriding-methods/ │ │ └── main.go │ ├── 06_struct-pointer/ │ │ └── main.go │ ├── 07_marshal_unmarshal/ │ │ ├── 01_marshal/ │ │ │ ├── 01_exported/ │ │ │ │ └── main.go │ │ │ ├── 02_unexported/ │ │ │ │ └── main.go │ │ │ └── 03_tags/ │ │ │ └── main.go │ │ └── 02_unmarshal/ │ │ ├── 01/ │ │ │ └── main.go │ │ └── 02_tags/ │ │ └── main.go │ └── 08_encode_decode/ │ ├── 01_encode/ │ │ └── main.go │ └── 02_decode/ │ └── main.go ├── 21_interfaces/ │ ├── 00_notes.txt │ ├── 01_interface/ │ │ ├── 01_no-interface/ │ │ │ └── main.go │ │ ├── 02_interface/ │ │ │ └── main.go │ │ ├── 03_interface/ │ │ │ └── main.go │ │ ├── 04_interface/ │ │ │ └── main.go │ │ └── 05_io-copy/ │ │ ├── 01_no-error-checking/ │ │ │ └── main.go │ │ └── 02_error-checking/ │ │ └── main.go │ ├── 02_package-sort/ │ │ ├── 00_notes.txt │ │ ├── 01_sort-names/ │ │ │ └── main.go │ │ ├── 02_sort-names_type-StringSlice/ │ │ │ └── main.go │ │ ├── 03_sort-Strings/ │ │ │ └── main.go │ │ ├── 04_sort-names_type-StringSlice_reverse/ │ │ │ └── main.go │ │ ├── 05_sort-int_type-IntSlice/ │ │ │ └── main.go │ │ ├── 06_sort-int_type-IntSlice_reverse/ │ │ │ └── main.go │ │ ├── 07_sort-Ints/ │ │ │ └── main.go │ │ └── 08_standard-library-example/ │ │ └── main.go │ ├── 03_empty-interface/ │ │ ├── 01_no-interface/ │ │ │ └── main.go │ │ ├── 02_empty-interface/ │ │ │ └── main.go │ │ ├── 03_param-accepts-any-type/ │ │ │ └── main.go │ │ └── 04_slice-of-any-type/ │ │ └── main.go │ ├── 04_method-sets/ │ │ ├── 01_value-receiver_value-type/ │ │ │ └── main.go │ │ ├── 02_value-receiver_pointer-type/ │ │ │ └── main.go │ │ ├── 03_pointer-receiver_pointer-type/ │ │ │ └── main.go │ │ └── 04_pointer-receiver_value-type/ │ │ └── main.go │ └── 05_conversion-vs-assertion/ │ ├── 01_conversion/ │ │ ├── 01_int-to-float/ │ │ │ └── main.go │ │ ├── 02_float-to-int/ │ │ │ └── main.go │ │ ├── 03_rune-to-string/ │ │ │ └── main.go │ │ ├── 04_rune-to-slice-of-bytes-to-string/ │ │ │ └── main.go │ │ ├── 05_string-to-slice-of-bytes/ │ │ │ └── main.go │ │ └── 06_strconv/ │ │ ├── 01_Atoi/ │ │ │ └── main.go │ │ ├── 02_Itoa/ │ │ │ └── main.go │ │ └── 03_ParseInt/ │ │ └── main.go │ └── 02_assertion/ │ ├── 01_non-interface-error_invalid-code/ │ │ └── main.go │ ├── 02_interface-string/ │ │ └── main.go │ ├── 03_interface-string_not-ok/ │ │ └── main.go │ ├── 04_interface-int_print-type/ │ │ └── main.go │ ├── 05_interface-int_mistmatched-types-error/ │ │ └── main.go │ ├── 06_interface-int-sum/ │ │ └── main.go │ ├── 07_casting-reminder/ │ │ └── main.go │ └── 08_interface-cast-error_need-type-assertion/ │ └── main.go ├── 22_go-routines/ │ ├── 01_no-go/ │ │ └── main.go │ ├── 02_go_concurrency/ │ │ └── main.go │ ├── 03_wait-group/ │ │ └── main.go │ ├── 04_time-sleep/ │ │ └── main.go │ ├── 05_gomaxprocs_parallelism/ │ │ └── main.go │ ├── 06_race-condition/ │ │ └── main.go │ ├── 07_mutex/ │ │ └── main.go │ ├── 08_atomicity/ │ │ └── main.go │ ├── 09_channels/ │ │ ├── 00_unbuffered-channels-block/ │ │ │ └── main.go │ │ ├── 01_range/ │ │ │ └── main.go │ │ ├── 02_n-to-1/ │ │ │ ├── 01_race-condition/ │ │ │ │ └── main.go │ │ │ ├── 02_wait-group/ │ │ │ │ └── main.go │ │ │ ├── 03_semaphore/ │ │ │ │ └── main.go │ │ │ ├── 04_semaphore_wrong-way/ │ │ │ │ └── main.go │ │ │ └── 05_n-times_to_1/ │ │ │ └── main.go │ │ ├── 03_1-to-n/ │ │ │ ├── 01_1_to_2-times/ │ │ │ │ └── main.go │ │ │ └── 02_1_to_n-times/ │ │ │ └── main.go │ │ ├── 04_pass-return-channels/ │ │ │ └── main.go │ │ ├── 05_channel-direction/ │ │ │ └── main.go │ │ ├── 06_refactor/ │ │ │ └── main.go │ │ ├── 07_incrementor/ │ │ │ └── main.go │ │ └── 08_closures/ │ │ ├── 01_no-closure-binding/ │ │ │ └── main.go │ │ ├── 02_closure-binding/ │ │ │ └── main.go │ │ └── 03_closure-binding/ │ │ └── main.go │ ├── 10_deadlock-challenges/ │ │ ├── 01_deadlock-challenge/ │ │ │ └── main.go │ │ ├── 02_deadlock-solution/ │ │ │ └── main.go │ │ ├── 03_deadlock-challenge/ │ │ │ └── main.go │ │ ├── 04_deadlock-challenge/ │ │ │ └── main.go │ │ └── 05_deadlock-solution/ │ │ └── main.go │ ├── 11_factorial-challenge/ │ │ ├── 01_challenge-description/ │ │ │ └── main.go │ │ └── 02_challenge-solution/ │ │ └── main.go │ ├── 12_channels_pipeline/ │ │ ├── 01_sq-output/ │ │ │ └── main.go │ │ ├── 02_sq-output/ │ │ │ └── main.go │ │ ├── 03_challenge-description/ │ │ │ └── main.go │ │ └── 04_challenge-solution/ │ │ ├── 01_original-solution/ │ │ │ └── main.go │ │ ├── 02_another-solution/ │ │ │ └── main.go │ │ └── README.md │ ├── 13_channels_fan-out_fan-in/ │ │ ├── 01_boring/ │ │ │ └── main.go │ │ ├── 02_sq-output/ │ │ │ └── main.go │ │ ├── 03_sq-output_variation/ │ │ │ └── main.go │ │ ├── 04_challenge-description/ │ │ │ └── main.go │ │ ├── 05_challenge-solution/ │ │ │ └── main.go │ │ ├── 06_challenge-description/ │ │ │ └── main.go │ │ ├── 07_challenge-solution/ │ │ │ └── main.go │ │ ├── 08_challenge-description/ │ │ │ └── main.go │ │ ├── 09_challenge-solution/ │ │ │ ├── 01_troubleshooting-step/ │ │ │ │ └── main.go │ │ │ └── 02_solution/ │ │ │ └── main.go │ │ └── 10_van-sickle_fan-out_fan-in/ │ │ └── main.go │ ├── 14_incrementor-challenge/ │ │ ├── 01_description/ │ │ │ └── main.go │ │ └── 02_solution/ │ │ └── main.go │ └── 15_for-fun/ │ ├── 01/ │ │ └── main.go │ └── README.md ├── 23_error-handling/ │ ├── 01_golint/ │ │ ├── 01_before/ │ │ │ └── main.go │ │ └── 02_after/ │ │ └── main.go │ ├── 02_err-not-nil/ │ │ ├── 01_fmt-println/ │ │ │ └── main.go │ │ ├── 02_log-println/ │ │ │ └── main.go │ │ ├── 03_log-set-output/ │ │ │ ├── log.txt │ │ │ └── main.go │ │ ├── 04_log-fatalln/ │ │ │ └── main.go │ │ └── 05_panic/ │ │ └── main.go │ └── 03_custom-errors/ │ ├── 01_errors-new/ │ │ └── main.go │ ├── 02_errors-new_var/ │ │ └── main.go │ ├── 03_fmt-errorf/ │ │ └── main.go │ ├── 04_fmt-errorf_var/ │ │ └── main.go │ └── 05_custom-type/ │ └── main.go ├── 24_testing/ │ ├── math.go │ └── math_test.go ├── 25_code-walk/ │ ├── main.go │ └── with-comments/ │ └── main.go ├── 26_QUESTIONS-FROM-STUDENTS/ │ ├── 01-package-scope/ │ │ ├── main.go │ │ └── variables.go │ ├── 02-goroutines-printing/ │ │ └── main.go │ ├── 03-range-chan/ │ │ └── main.go │ ├── 04_goroutines_closing-chan/ │ │ ├── 01_broken-code/ │ │ │ └── main.go │ │ └── 02_fixed-code/ │ │ └── main.go │ ├── 05_concurrency-channels/ │ │ └── main.go │ └── 06_performance-ramifications/ │ ├── 01_called/ │ │ └── main.go │ └── 02_not-called/ │ └── main.go ├── 27_code-in-process/ │ ├── 26_playing-with-type/ │ │ ├── 00_types/ │ │ │ ├── 01_division/ │ │ │ │ ├── 01_int-int/ │ │ │ │ │ └── main.go │ │ │ │ ├── 02_int-float/ │ │ │ │ │ └── main.go │ │ │ │ ├── 03_var_int-float/ │ │ │ │ │ └── main.go │ │ │ │ └── 04_var_int-float_invalid-code/ │ │ │ │ └── main.go │ │ │ ├── 02_strings/ │ │ │ │ ├── 01_escape-sequences/ │ │ │ │ │ └── main.go │ │ │ │ ├── 02_sequence-of-bytes/ │ │ │ │ │ └── main.go │ │ │ │ ├── 03_immutable/ │ │ │ │ │ └── main.go │ │ │ │ ├── 04_len/ │ │ │ │ │ ├── 01_len-english/ │ │ │ │ │ │ └── main.go │ │ │ │ │ ├── 02_len-chinese/ │ │ │ │ │ │ └── main.go │ │ │ │ │ └── 03_binary/ │ │ │ │ │ └── main.go │ │ │ │ ├── 05_index-access/ │ │ │ │ │ └── main.go │ │ │ │ ├── 06_slicing/ │ │ │ │ │ ├── 01/ │ │ │ │ │ │ └── main.go │ │ │ │ │ ├── 02/ │ │ │ │ │ │ └── main.go │ │ │ │ │ └── 03_invalid_negative-index/ │ │ │ │ │ └── main.go │ │ │ │ └── 07_concatenation/ │ │ │ │ └── main.go │ │ │ ├── 03_strconv/ │ │ │ │ ├── 01_itoa/ │ │ │ │ │ └── main.go │ │ │ │ ├── 02_fmt-sprint/ │ │ │ │ │ └── main.go │ │ │ │ └── 03_atoi/ │ │ │ │ └── main.go │ │ │ ├── 06_math-pkg/ │ │ │ │ └── main.go │ │ │ └── 07_typeOf/ │ │ │ ├── 01_better-code/ │ │ │ │ └── main.go │ │ │ └── 02_worse-code/ │ │ │ └── main.go │ │ ├── 01_struct/ │ │ │ └── main.go │ │ ├── 02_string/ │ │ │ └── main.go │ │ ├── 03_string-conversion/ │ │ │ └── main.go │ │ ├── 04_string_assertion_invalid-code/ │ │ │ └── main.go │ │ ├── 05_var-for-zero-val-initalization/ │ │ │ └── main.go │ │ ├── 06_shorthand-notation_nonzero-initalization/ │ │ │ └── main.go │ │ ├── xx05_slice-strings/ │ │ │ └── main.go │ │ ├── xx06_slice-strings_conversion/ │ │ │ └── main.go │ │ ├── xx07_int/ │ │ │ └── main.go │ │ └── xx08_slice-ints/ │ │ └── main.go │ ├── 27_package-os/ │ │ ├── 00_args/ │ │ │ └── main.go │ │ ├── 01_Read/ │ │ │ └── 01/ │ │ │ ├── dst.txt │ │ │ ├── main.go │ │ │ └── src.txt │ │ ├── 02_Write/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ ├── 02/ │ │ │ │ ├── hello.txt │ │ │ │ └── main.go │ │ │ └── 03_absolute-path/ │ │ │ └── main.go │ │ ├── 03_mkdir/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ └── 02/ │ │ │ └── main.go │ │ ├── 04_FileMode/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ └── 02/ │ │ │ └── main.go │ │ ├── 05_file-open/ │ │ │ └── main.go │ │ ├── 06_file-create/ │ │ │ └── main.go │ │ └── 07_Stdout_Stdin/ │ │ ├── 01/ │ │ │ └── main.go │ │ └── 02/ │ │ └── main.go │ ├── 28_package-strings/ │ │ ├── 01_strings/ │ │ │ └── main.go │ │ └── 02_NewReader/ │ │ └── main.go │ ├── 29_package-bufio/ │ │ ├── 01_NewReader/ │ │ │ └── main.go │ │ ├── 02_NewScanner/ │ │ │ └── main.go │ │ ├── 03_scan-lines/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ └── 02/ │ │ │ └── main.go │ │ └── 04_scan-words/ │ │ ├── 01/ │ │ │ └── main.go │ │ ├── 02/ │ │ │ └── main.go │ │ └── 03/ │ │ └── main.go │ ├── 30_package-io/ │ │ ├── 01_copy/ │ │ │ └── main.go │ │ ├── 02_copy/ │ │ │ └── main.go │ │ ├── 03_copy/ │ │ │ └── main.go │ │ ├── 04_TeeReader/ │ │ │ ├── 01/ │ │ │ │ ├── main.go │ │ │ │ └── src.txt │ │ │ └── 02/ │ │ │ ├── main.go │ │ │ └── src.txt │ │ ├── 05_ReadFull/ │ │ │ ├── dst.txt │ │ │ ├── main.go │ │ │ └── src.txt │ │ ├── 06_LimitReader/ │ │ │ ├── main.go │ │ │ └── src.txt │ │ └── 07_WriteString/ │ │ ├── 01_one-way/ │ │ │ ├── hello.txt │ │ │ └── main.go │ │ └── 02_another-way/ │ │ ├── hello.txt │ │ └── main.go │ ├── 31_package-ioutil/ │ │ ├── 00_ReadAll/ │ │ │ └── main.go │ │ ├── 01_ReadAll/ │ │ │ └── main.go │ │ ├── 02_WriteFile/ │ │ │ └── main.go │ │ └── 03_ReadAll_WriteFile/ │ │ ├── hey.txt │ │ └── main.go │ ├── 32_package-encoding-csv/ │ │ ├── 01_NewReader/ │ │ │ └── main.go │ │ ├── 02_column-headings/ │ │ │ └── main.go │ │ ├── 03_panics/ │ │ │ └── main.go │ │ ├── 04_parse-state/ │ │ │ └── main.go │ │ ├── 05_state-lookup/ │ │ │ └── main.go │ │ ├── 06_write-to-html/ │ │ │ └── main.go │ │ ├── 07_NewReader/ │ │ │ ├── main.go │ │ │ └── table.csv │ │ └── state_table.csv │ ├── 33_package-path-filepath/ │ │ ├── 01_Walk/ │ │ │ └── main.go │ │ ├── 02_Walk/ │ │ │ └── main.go │ │ ├── 03_Walk/ │ │ │ └── main.go │ │ └── 04_Walk/ │ │ └── main.go │ ├── 34_package-time/ │ │ ├── 01_now/ │ │ │ └── main.go │ │ ├── 02_time-parse/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ └── 02/ │ │ │ └── main.go │ │ ├── 03_format/ │ │ │ └── main.go │ │ └── 04_date-diff/ │ │ └── main.go │ ├── 35_hash/ │ │ ├── 00_notes/ │ │ │ └── notes.txt │ │ ├── 01_FNV/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ └── 02/ │ │ │ └── main.go │ │ └── 02_MD5/ │ │ ├── 01/ │ │ │ └── main.go │ │ └── 02/ │ │ └── main.go │ ├── 36_package-filepath/ │ │ └── 01_walk/ │ │ └── main.go │ ├── 37_review-exercises/ │ │ ├── 01_gravatar/ │ │ │ ├── main.go │ │ │ └── page.html │ │ ├── 02_word-count/ │ │ │ └── main.go │ │ ├── 03_centered_average/ │ │ │ └── main.go │ │ ├── 04_swap-two_pointers/ │ │ │ └── main.go │ │ ├── 05_clumps/ │ │ │ └── main.go │ │ ├── 06_cat/ │ │ │ └── main.go │ │ ├── 07_copy/ │ │ │ ├── main.go │ │ │ └── newFile.txt │ │ ├── 08_cp/ │ │ │ ├── 01/ │ │ │ │ ├── initial.txt │ │ │ │ └── main.go │ │ │ ├── 02/ │ │ │ │ ├── initial.txt │ │ │ │ └── main.go │ │ │ ├── 03/ │ │ │ │ ├── initial.txt │ │ │ │ └── main.go │ │ │ ├── 04_io-copy/ │ │ │ │ ├── initial.txt │ │ │ │ └── main.go │ │ │ ├── 05_os-write_slice-bytes/ │ │ │ │ └── main.go │ │ │ ├── 06_io-copy_string-NewReader/ │ │ │ │ └── main.go │ │ │ ├── 07_io-copy_bufio-NewReader/ │ │ │ │ ├── initial.txt │ │ │ │ └── main.go │ │ │ └── 08_bufio_scanner/ │ │ │ ├── initial.txt │ │ │ └── main.go │ │ ├── 09_sentence-case/ │ │ │ ├── initial.txt │ │ │ └── main.go │ │ ├── 10_every-word/ │ │ │ ├── initial.txt │ │ │ └── main.go │ │ ├── 11_every-other-word/ │ │ │ ├── initial.txt │ │ │ └── main.go │ │ ├── 12_count-words/ │ │ │ └── main.go │ │ ├── 13_longest-word/ │ │ │ └── main.go │ │ ├── 14_cat-files/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ └── 02/ │ │ │ └── main.go │ │ ├── 15_csv_state-info/ │ │ │ ├── state_table.csv │ │ │ ├── step01_read-and-output/ │ │ │ │ └── main.go │ │ │ ├── step02_column-headings/ │ │ │ │ └── main.go │ │ │ ├── step03_panics/ │ │ │ │ └── main.go │ │ │ ├── step04_parse-state/ │ │ │ │ └── main.go │ │ │ ├── step05_state-lookup/ │ │ │ │ └── main.go │ │ │ └── step06_write-to-html/ │ │ │ └── main.go │ │ ├── 16_csv_stock-prices/ │ │ │ ├── step01_stdout/ │ │ │ │ └── main.go │ │ │ ├── step02_html/ │ │ │ │ └── main.go │ │ │ ├── step03_charting/ │ │ │ │ ├── charting_graphing.txt │ │ │ │ └── main.go │ │ │ └── table.csv │ │ ├── 17_MD5-checksum/ │ │ │ └── main.go │ │ └── 18_Walk-dir/ │ │ └── main.go │ ├── 38_JSON/ │ │ ├── 01/ │ │ │ └── main.go │ │ ├── 02/ │ │ │ └── main.go │ │ ├── 03/ │ │ │ └── main.go │ │ ├── 04/ │ │ │ └── main.go │ │ ├── 05/ │ │ │ └── main.go │ │ ├── 06/ │ │ │ └── main.go │ │ ├── 07/ │ │ │ └── main.go │ │ ├── 08/ │ │ │ └── main.go │ │ ├── 09/ │ │ │ └── main.go │ │ ├── 10/ │ │ │ └── main.go │ │ ├── 11/ │ │ │ └── main.go │ │ ├── 12/ │ │ │ ├── data.json │ │ │ └── main.go │ │ ├── 13/ │ │ │ ├── data.json │ │ │ └── main.go │ │ ├── 14/ │ │ │ └── main.go │ │ ├── 15/ │ │ │ ├── main.go │ │ │ └── output.txt │ │ ├── 15_exercise_csv-to-JSON/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ ├── 02/ │ │ │ │ ├── main.go │ │ │ │ └── output.txt │ │ │ └── table.csv │ │ ├── 16/ │ │ │ └── main.go │ │ └── 17/ │ │ ├── main.go │ │ └── table.json │ ├── 39_packages/ │ │ ├── hello/ │ │ │ ├── bye.go │ │ │ └── hello.go │ │ └── main/ │ │ └── main.go │ ├── 40_testing/ │ │ ├── 01/ │ │ │ ├── example/ │ │ │ │ ├── sum.go │ │ │ │ └── sum_test.go │ │ │ └── main.go │ │ └── 02/ │ │ ├── example/ │ │ │ ├── sum.go │ │ │ └── sum_test.go │ │ └── main.go │ ├── 41_TCP/ │ │ ├── 01/ │ │ │ └── 00_notes.txt │ │ ├── 02_listen/ │ │ │ ├── 00_notes.txt │ │ │ └── main.go │ │ ├── 03_dial/ │ │ │ ├── 00_notes.txt │ │ │ └── main.go │ │ ├── 04_echo-server/ │ │ │ ├── v01/ │ │ │ │ ├── 00_notes.txt │ │ │ │ └── main.go │ │ │ ├── v02/ │ │ │ │ ├── 00_notes.txt │ │ │ │ └── main.go │ │ │ ├── v03/ │ │ │ │ └── main.go │ │ │ └── v04/ │ │ │ └── main.go │ │ ├── 05_redis-clone/ │ │ │ ├── i01/ │ │ │ │ ├── i01_notes.txt │ │ │ │ └── main.go │ │ │ ├── i02/ │ │ │ │ ├── i02_notes.txt │ │ │ │ └── main.go │ │ │ ├── i03/ │ │ │ │ ├── i03_notes.txt │ │ │ │ └── main.go │ │ │ ├── i04/ │ │ │ │ ├── i04_notes.txt │ │ │ │ └── main.go │ │ │ ├── i05_code-issue/ │ │ │ │ ├── i04_notes.txt │ │ │ │ └── main.go │ │ │ └── i06/ │ │ │ ├── i04_notes.txt │ │ │ └── main.go │ │ ├── 06_rot13-server/ │ │ │ ├── v01-todd/ │ │ │ │ └── main.go │ │ │ ├── v02-caleb/ │ │ │ │ └── main.go │ │ │ └── v03-daniel/ │ │ │ └── main.go │ │ └── 07_chat-server/ │ │ └── main.go │ ├── 42_HTTP/ │ │ ├── 01_header/ │ │ │ ├── 00_notes.txt │ │ │ └── main.go │ │ ├── 02_http-server/ │ │ │ ├── i01/ │ │ │ │ └── main.go │ │ │ ├── i02/ │ │ │ │ └── main.go │ │ │ ├── i03/ │ │ │ │ └── main.go │ │ │ ├── i04_POST/ │ │ │ │ └── main.go │ │ │ ├── i05_not-writing_error-in-code/ │ │ │ │ └── main.go │ │ │ ├── i06_PLAIN-TEXT/ │ │ │ │ └── main.go │ │ │ └── i07_Location/ │ │ │ └── main.go │ │ └── 03_http-server_return-URL/ │ │ └── main.go │ ├── 43_HTTP-server/ │ │ ├── 01/ │ │ │ ├── i01/ │ │ │ │ └── main.go │ │ │ └── i02/ │ │ │ └── main.go │ │ ├── 02_requestURI/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ └── 02/ │ │ │ └── main.go │ │ └── 03_restful/ │ │ ├── 01/ │ │ │ └── main.go │ │ ├── 02/ │ │ │ └── main.go │ │ └── 03/ │ │ └── main.go │ ├── 44_MUX_routing/ │ │ ├── 01/ │ │ │ └── main.go │ │ ├── 02/ │ │ │ └── main.go │ │ ├── 03/ │ │ │ └── main.go │ │ ├── 04/ │ │ │ └── main.go │ │ ├── 05/ │ │ │ └── main.go │ │ ├── 06_HandleFunc/ │ │ │ └── main.go │ │ ├── 07_HandleFunc/ │ │ │ └── main.go │ │ └── 08_HandleFunc/ │ │ └── main.go │ ├── 45_serving-files/ │ │ ├── 01/ │ │ │ └── main.go │ │ ├── 02/ │ │ │ └── main.go │ │ ├── 03/ │ │ │ └── main.go │ │ ├── 04_io-Copy/ │ │ │ └── main.go │ │ ├── 05_ServeContent/ │ │ │ └── main.go │ │ ├── 06_ServeFile/ │ │ │ └── main.go │ │ ├── 07_FileServer/ │ │ │ └── main.go │ │ ├── 08_FileServer/ │ │ │ └── main.go │ │ ├── 09_FileServer/ │ │ │ └── main.go │ │ ├── 10_static-file-server/ │ │ │ └── main.go │ │ └── 11_static-file-server/ │ │ └── main.go │ ├── 46_errata/ │ │ ├── 01_set-header/ │ │ │ └── main.go │ │ ├── 02_URL/ │ │ │ └── main.go │ │ ├── 03_URL/ │ │ │ └── main.go │ │ ├── 04_URL/ │ │ │ └── main.go │ │ └── 05_ServeFile/ │ │ └── main.go │ ├── 47_templates/ │ │ ├── 01_text-templates/ │ │ │ ├── 01/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── 02/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── 03/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── 04/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── 05/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── 06/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── 07/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── 08/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── 09_function/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── 10_function/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ └── 11/ │ │ │ ├── main.go │ │ │ └── tpl.gohtml │ │ ├── 02_html-templates/ │ │ │ ├── 01/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── 02/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── 03/ │ │ │ │ ├── main.go │ │ │ │ ├── tpl.gohtml │ │ │ │ └── tpl2.gohtml │ │ │ ├── 04/ │ │ │ │ ├── main.go │ │ │ │ ├── tpl.gohtml │ │ │ │ └── tpl2.gohtml │ │ │ └── 05/ │ │ │ ├── main.go │ │ │ └── templates/ │ │ │ ├── tpl.gohtml │ │ │ └── tpl2.gohtml │ │ └── x03_exercises/ │ │ ├── 01/ │ │ │ ├── hw.gohtml │ │ │ └── main.go │ │ ├── 02/ │ │ │ ├── hw.gohtml │ │ │ └── main.go │ │ └── 03_template_csv-parse/ │ │ ├── hw.gohtml │ │ ├── main.go │ │ ├── parse/ │ │ │ └── parse.go │ │ └── table.csv │ ├── 48_passing-data/ │ │ ├── 01_URL-values/ │ │ │ └── main.go │ │ ├── 02_form-values/ │ │ │ └── main.go │ │ ├── 03_form-values/ │ │ │ └── main.go │ │ ├── 04_form-values/ │ │ │ └── main.go │ │ ├── 05_form-values/ │ │ │ └── main.go │ │ ├── 06_form-values/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ └── 02/ │ │ │ └── main.go │ │ ├── 07_form-data/ │ │ │ ├── form.gohtml │ │ │ ├── main.go │ │ │ └── sample.html │ │ └── 08_form_file-upload/ │ │ ├── 01/ │ │ │ ├── form.gohtml │ │ │ ├── main.go │ │ │ └── sample.html │ │ ├── 02/ │ │ │ ├── form.gohtml │ │ │ ├── main.go │ │ │ └── sample.html │ │ ├── 03/ │ │ │ └── main.go │ │ └── 04/ │ │ ├── file.txt │ │ └── main.go │ ├── 49_cookies-sessions/ │ │ ├── 01_set-cookie/ │ │ │ └── main.go │ │ ├── 02_get-cookie/ │ │ │ └── main.go │ │ ├── 03_sessions/ │ │ │ └── main.go │ │ ├── 04_sessions/ │ │ │ └── main.go │ │ ├── 05_sessions-HMAC/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ └── 02/ │ │ │ └── main.go │ │ ├── 06_sessions_GORILLA/ │ │ │ └── main.go │ │ ├── 07_cookies_show-visits/ │ │ │ └── main.go │ │ ├── 08_log-in-out/ │ │ │ └── main.go │ │ ├── 09_HTTPS-TLS/ │ │ │ └── main.go │ │ ├── 10_HTTPS-TLS/ │ │ │ └── main.go │ │ ├── 11_HTTPS-TLS/ │ │ │ └── main.go │ │ └── 12_GORILLA_photo-blog/ │ │ ├── assets/ │ │ │ └── templates/ │ │ │ ├── index.html │ │ │ └── login.html │ │ └── main.go │ ├── 50_exif/ │ │ └── main.go │ ├── 51_appengine-introduction/ │ │ ├── 01_hello-world/ │ │ │ ├── app.yaml │ │ │ └── hello.go │ │ ├── 02_photo-blog_somewhat-crappy-code-FYI/ │ │ │ ├── app.yaml │ │ │ ├── assets/ │ │ │ │ └── tpl/ │ │ │ │ ├── admin_login.gohtml │ │ │ │ ├── admin_upload.gohtml │ │ │ │ └── index.gohtml │ │ │ └── photos.go │ │ ├── 03_google-maps-api/ │ │ │ ├── app.yaml │ │ │ ├── assets/ │ │ │ │ └── templates/ │ │ │ │ └── index.gohtml │ │ │ └── hello.go │ │ ├── 04_SERVICE_users/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ └── 05_GORILLA_photo-blog/ │ │ ├── app.yaml │ │ ├── assets/ │ │ │ └── templates/ │ │ │ ├── index.html │ │ │ └── login.html │ │ └── main.go │ ├── 52_memcache/ │ │ ├── 01_get-nil/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ ├── 02_set_get/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ ├── 03_expiration/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ ├── 04_increment/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ └── 05_memcache-session/ │ │ ├── 01i/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ ├── 02i/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ ├── 03i/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ ├── 04i/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ ├── 05i/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ └── 06_photo-blog_UNFINISHED/ │ │ ├── app.yaml │ │ ├── assets/ │ │ │ └── templates/ │ │ │ ├── index.html │ │ │ └── login.html │ │ └── main.go │ ├── 53_datastore/ │ │ ├── 00_appengine-documentation-example/ │ │ │ ├── 01_with-modifications/ │ │ │ │ ├── app.yaml │ │ │ │ └── main.go │ │ │ ├── 02_as-in-documentation/ │ │ │ │ ├── app.yaml │ │ │ │ └── main.go │ │ │ ├── 03_no-favicon/ │ │ │ │ ├── app.yaml │ │ │ │ └── main.go │ │ │ └── 04_no-favicon/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ ├── 01_partial-example_does-not-run/ │ │ │ └── main.go │ │ ├── 02/ │ │ │ ├── 01_put/ │ │ │ │ ├── app.yaml │ │ │ │ └── words.go │ │ │ ├── 02/ │ │ │ │ ├── app.yaml │ │ │ │ └── words.go │ │ │ ├── 03_get/ │ │ │ │ ├── app.yaml │ │ │ │ └── words.go │ │ │ ├── 04_query-filter/ │ │ │ │ ├── app.yaml │ │ │ │ └── words.go │ │ │ └── 05_query-ancestor/ │ │ │ ├── app.yaml │ │ │ └── words.go │ │ ├── 03_users_datastore_exercise/ │ │ │ ├── app.yaml │ │ │ ├── main.go │ │ │ └── templates/ │ │ │ └── templates.gohtml │ │ └── 04_julien-schmidt-router/ │ │ ├── 01/ │ │ │ └── main.go │ │ └── 02-with-appengine/ │ │ ├── app.yaml │ │ └── main.go │ ├── 54_AJAX/ │ │ ├── 01/ │ │ │ ├── index.html │ │ │ └── test.html │ │ └── 02_users_datastore_exercise_AJAX/ │ │ ├── app.yaml │ │ ├── main.go │ │ └── templates/ │ │ └── templates.gohtml │ ├── 55_todo-list/ │ │ ├── 01v_content-editable/ │ │ │ ├── app.yaml │ │ │ ├── assets/ │ │ │ │ └── templates/ │ │ │ │ └── index.html │ │ │ └── main.go │ │ └── 02v_input/ │ │ ├── app.yaml │ │ ├── assets/ │ │ │ └── templates/ │ │ │ └── index.html │ │ └── main.go │ ├── 56_twitter/ │ │ ├── 01_ux_design/ │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── reset.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ └── home.html │ │ ├── 02_ListenAndServe/ │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── reset.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ └── home.html │ │ ├── 03_error-handling/ │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── reset.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ └── home.html │ │ ├── 04_template_abstraction/ │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── reset.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ └── home.html │ │ ├── 05_document/ │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── reset.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ └── home.html │ │ ├── 06_document/ │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── reset.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ └── home.html │ │ ├── 07_app-engine/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── reset.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ └── home.html │ │ ├── 08_julien-schmidt/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── reset.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ └── home.html │ │ ├── 09_login-form/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── temp/ │ │ │ │ └── tempLogin.html │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ ├── header2.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 10_signup-form-validate/ │ │ │ ├── 01v_form-validation/ │ │ │ │ ├── app.yaml │ │ │ │ ├── doc.go │ │ │ │ ├── main.go │ │ │ │ ├── public/ │ │ │ │ │ └── css/ │ │ │ │ │ ├── login.css │ │ │ │ │ ├── reset.css │ │ │ │ │ ├── signup.css │ │ │ │ │ └── styles.css │ │ │ │ ├── temp/ │ │ │ │ │ ├── tempLogin.html │ │ │ │ │ ├── tempSignup.html │ │ │ │ │ └── test-js.html │ │ │ │ └── templates/ │ │ │ │ └── html/ │ │ │ │ ├── footer.html │ │ │ │ ├── header.html │ │ │ │ ├── header2.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ └── signup.html │ │ │ └── 02v_datastore-put/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── temp/ │ │ │ │ ├── tempLogin.html │ │ │ │ ├── tempSignup.html │ │ │ │ └── test-js.html │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ ├── header2.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 11_HTTPS-TLS/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── err_main.tmp │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ ├── header2.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 12_error-handling/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ ├── header2.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 13_login_unfinished/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ ├── header2.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 14_code-review/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 15_memcache-home/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 16_abstract-memcache-code/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 17_memcache-templates/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── memcache.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 18_abstract-API-Model/ │ │ │ ├── API/ │ │ │ │ └── users.go │ │ │ ├── IMPORTANT-READ-ME.txt │ │ │ ├── Memcache/ │ │ │ │ └── templates.go │ │ │ ├── Model/ │ │ │ │ └── users.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 19_abstract-API-Model_AE-fix/ │ │ │ ├── API/ │ │ │ │ └── users.go │ │ │ ├── App/ │ │ │ │ ├── app.yaml │ │ │ │ ├── doc.go │ │ │ │ ├── main.go │ │ │ │ ├── public/ │ │ │ │ │ └── css/ │ │ │ │ │ ├── login.css │ │ │ │ │ ├── reset.css │ │ │ │ │ ├── signup.css │ │ │ │ │ └── styles.css │ │ │ │ └── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ └── signup.html │ │ │ ├── Memcache/ │ │ │ │ └── templates.go │ │ │ └── Model/ │ │ │ └── users.go │ │ ├── 20_reverting_to_only_package-main/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── memcache.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ └── signup.html │ │ │ └── userCreation.go │ │ ├── 21_set-cookie_no-PATH/ │ │ │ ├── IMPORTANT-TO-READ.txt │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── memcache.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ └── signup.html │ │ │ └── userCreation.go │ │ ├── 22_set-cookie_PATH/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── memcache.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ └── signup.html │ │ │ └── userCreation.go │ │ ├── 23_set-cookie-UUID/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── memcache.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ └── signup.html │ │ │ └── userCreation.go │ │ ├── 24_session/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── memcache.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ └── signup.html │ │ │ └── userCreation.go │ │ ├── 25_session-all-pages/ │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ └── signup.html │ │ │ └── userCreation.go │ │ ├── 26_login/ │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── notes.txt │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 27_logout/ │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 28_code-review/ │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 29_password-encryption/ │ │ │ ├── READ-ME.txt │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 30_turn-off-memcache/ │ │ │ ├── READ-ME.txt │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── 31_modal-post-tweet/ │ │ │ ├── README.txt │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── modal-tweet.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ ├── modal-tweet.html │ │ │ └── signup.html │ │ ├── 32_tweets/ │ │ │ ├── READ-ME.txt │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── modal-tweet.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ └── templates/ │ │ │ └── html/ │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ ├── modal-tweet.html │ │ │ └── signup.html │ │ ├── 33_display-all-tweets/ │ │ │ ├── READ-ME.txt │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── modal-tweet.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ ├── modal-tweet.html │ │ │ │ └── signup.html │ │ │ └── tweets.go │ │ ├── 34_humanize/ │ │ │ ├── READ-ME.txt │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── modal-tweet.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ ├── modal-tweet.html │ │ │ │ └── signup.html │ │ │ └── tweets.go │ │ ├── 35_schmidt-params/ │ │ │ ├── 01/ │ │ │ │ └── main.go │ │ │ ├── 02/ │ │ │ │ └── main.go │ │ │ ├── 03/ │ │ │ │ └── main.go │ │ │ ├── 04/ │ │ │ │ └── main.go │ │ │ └── 05/ │ │ │ └── main.go │ │ ├── 36_user-tweets/ │ │ │ ├── READ-ME.txt │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── index.yaml │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── modal-tweet.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ ├── modal-tweet.html │ │ │ │ └── signup.html │ │ │ └── tweets.go │ │ ├── 37_other-implementations/ │ │ │ ├── 01_daniel/ │ │ │ │ ├── app.yaml │ │ │ │ ├── data.go │ │ │ │ ├── email.go │ │ │ │ ├── index.yaml │ │ │ │ ├── main.go │ │ │ │ ├── public/ │ │ │ │ │ ├── makeTweet.js │ │ │ │ │ └── style.css │ │ │ │ └── templates/ │ │ │ │ ├── createProfile.gohtml │ │ │ │ ├── index.gohtml │ │ │ │ ├── login.gohtml │ │ │ │ ├── profile.gohtml │ │ │ │ └── tweet.gohtml │ │ │ ├── 02_tommy/ │ │ │ │ ├── README.md │ │ │ │ ├── app.yaml │ │ │ │ ├── assets/ │ │ │ │ │ └── scripts/ │ │ │ │ │ └── main.js │ │ │ │ ├── data.go │ │ │ │ ├── handlers.go │ │ │ │ ├── main.go │ │ │ │ ├── render.go │ │ │ │ └── templates/ │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ └── profile.html │ │ │ └── 03_t/ │ │ │ ├── app.yaml │ │ │ ├── data.go │ │ │ ├── index.yaml │ │ │ ├── public/ │ │ │ │ ├── css/ │ │ │ │ │ └── reset.css │ │ │ │ └── js/ │ │ │ │ └── make-post.js │ │ │ ├── routes.go │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── footer.html │ │ │ │ ├── header.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ └── profile.html │ │ │ ├── templates.go │ │ │ └── temporary/ │ │ │ ├── modal-dialog.html │ │ │ ├── temp_home.html │ │ │ ├── temp_login.html │ │ │ └── temp_profile.html │ │ ├── 38_follow/ │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── following.go │ │ │ ├── index.yaml │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── modal-tweet.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ ├── modal-tweet.html │ │ │ │ ├── signup.html │ │ │ │ └── user.html │ │ │ └── tweets.go │ │ ├── 39_unfollow/ │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── following.go │ │ │ ├── index.yaml │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── modal-tweet.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ ├── modal-tweet.html │ │ │ │ ├── signup.html │ │ │ │ └── user.html │ │ │ └── tweets.go │ │ ├── 40_send-email/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ ├── 41_twitter-send-email/ │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── email.go │ │ │ ├── following.go │ │ │ ├── index.yaml │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── modal-tweet.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ ├── modal-tweet.html │ │ │ │ ├── signup.html │ │ │ │ └── user.html │ │ │ └── tweets.go │ │ ├── 42_following/ │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── email.go │ │ │ ├── following.go │ │ │ ├── index.yaml │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── modal-tweet.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── follow.html │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ ├── modal-tweet.html │ │ │ │ ├── signup.html │ │ │ │ └── user.html │ │ │ └── tweets.go │ │ ├── 43_following-me/ │ │ │ ├── api.go │ │ │ ├── app.yaml │ │ │ ├── doc.go │ │ │ ├── email.go │ │ │ ├── following.go │ │ │ ├── index.yaml │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ ├── public/ │ │ │ │ └── css/ │ │ │ │ ├── login.css │ │ │ │ ├── modal-tweet.css │ │ │ │ ├── reset.css │ │ │ │ ├── signup.css │ │ │ │ └── styles.css │ │ │ ├── session.go │ │ │ ├── template.go │ │ │ ├── templates/ │ │ │ │ └── html/ │ │ │ │ ├── follow.html │ │ │ │ ├── followingme.html │ │ │ │ ├── headersFooters.html │ │ │ │ ├── home.html │ │ │ │ ├── login.html │ │ │ │ ├── modal-tweet.html │ │ │ │ ├── signup.html │ │ │ │ └── user.html │ │ │ └── tweets.go │ │ └── 44_code-review/ │ │ ├── api.go │ │ ├── app.yaml │ │ ├── doc.go │ │ ├── email.go │ │ ├── following.go │ │ ├── index.yaml │ │ ├── main.go │ │ ├── model.go │ │ ├── public/ │ │ │ └── css/ │ │ │ ├── login.css │ │ │ ├── modal-tweet.css │ │ │ ├── reset.css │ │ │ ├── signup.css │ │ │ └── styles.css │ │ ├── session.go │ │ ├── template.go │ │ ├── templates/ │ │ │ └── html/ │ │ │ ├── follow.html │ │ │ ├── followingme.html │ │ │ ├── headersFooters.html │ │ │ ├── home.html │ │ │ ├── login.html │ │ │ ├── modal-tweet.html │ │ │ ├── signup.html │ │ │ └── user.html │ │ └── tweets.go │ ├── 57_appengine-channel/ │ │ ├── 01_basic/ │ │ │ ├── app.yaml │ │ │ └── channel.go │ │ └── 02_chat-room/ │ │ ├── app.yaml │ │ ├── handlers.go │ │ ├── public/ │ │ │ ├── index.html │ │ │ ├── main.css │ │ │ └── main.js │ │ ├── room.go │ │ └── routes.go │ ├── 58_appengine-search/ │ │ ├── app.yaml │ │ └── search.go │ ├── 59_appengine-GCS-storage/ │ │ ├── 00_GCS-setup/ │ │ │ └── 00_GCS-setup.txt │ │ ├── 01_NewWriter_PEM-auth/ │ │ │ ├── app.yaml │ │ │ └── storage.go │ │ ├── 02_NewWriter_JSON-auth/ │ │ │ ├── README.txt │ │ │ ├── app.yaml │ │ │ └── storage.go │ │ └── 03_put-get-list_JSON-auth/ │ │ ├── README.txt │ │ ├── app.yaml │ │ └── storage.go │ ├── 60_movie-website/ │ │ ├── 01_search/ │ │ │ ├── app.yaml │ │ │ ├── index.go │ │ │ ├── newmovie.go │ │ │ ├── public/ │ │ │ │ ├── main.css │ │ │ │ └── opensearch.xml │ │ │ ├── routes.go │ │ │ ├── search.go │ │ │ ├── templates/ │ │ │ │ ├── index.gohtml │ │ │ │ ├── layout.gohtml │ │ │ │ ├── new-movie.gohtml │ │ │ │ └── search.gohtml │ │ │ ├── templates.go │ │ │ └── types.go │ │ └── 02_image-upload-GCS/ │ │ ├── README.txt │ │ ├── app.yaml │ │ ├── index.go │ │ ├── newmovie.go │ │ ├── public/ │ │ │ ├── main.css │ │ │ └── opensearch.xml │ │ ├── routes.go │ │ ├── search.go │ │ ├── storage.go │ │ ├── templates/ │ │ │ ├── index.gohtml │ │ │ ├── layout.gohtml │ │ │ ├── new-movie.gohtml │ │ │ └── search.gohtml │ │ ├── templates.go │ │ └── types.go │ ├── 61_http-giffy/ │ │ ├── app.yaml │ │ └── http.go │ ├── 62_self-destructing-message/ │ │ ├── 01/ │ │ │ ├── app.yaml │ │ │ └── routes.go │ │ └── 02_crypto/ │ │ ├── 01_nonce/ │ │ │ └── main.go │ │ ├── 02_encrypt/ │ │ │ └── main.go │ │ ├── 03_decrypt/ │ │ │ └── main.go │ │ └── 04_complete/ │ │ ├── app.yaml │ │ └── routes.go │ ├── 63_GCS-filebrowser/ │ │ ├── README.txt │ │ ├── app.yaml │ │ ├── routes.go │ │ ├── session.go │ │ ├── storage.go │ │ └── templates/ │ │ ├── browse.html │ │ └── index.html │ ├── 64_csv-example/ │ │ ├── 01/ │ │ │ ├── app.yaml │ │ │ ├── routes.go │ │ │ └── stats.go │ │ └── 02/ │ │ ├── app.yaml │ │ ├── routes.go │ │ └── stats.go │ ├── 65_accepting-credit-cards/ │ │ ├── 01_basic-setup/ │ │ │ ├── app.yaml │ │ │ ├── routes.go │ │ │ └── templates/ │ │ │ └── index.gohtml │ │ ├── 02_customizing_UI/ │ │ │ ├── app.yaml │ │ │ ├── routes.go │ │ │ └── templates/ │ │ │ └── index.gohtml │ │ ├── 03_stripe-token/ │ │ │ ├── app.yaml │ │ │ ├── routes.go │ │ │ └── templates/ │ │ │ └── index.gohtml │ │ ├── 04_err-because-of-app-engine/ │ │ │ ├── app.yaml │ │ │ ├── routes.go │ │ │ ├── stripe.go │ │ │ └── templates/ │ │ │ └── index.gohtml │ │ ├── 05_charging/ │ │ │ ├── app.yaml │ │ │ ├── routes.go │ │ │ ├── stripe.go │ │ │ └── templates/ │ │ │ └── index.gohtml │ │ ├── 06_idempotent/ │ │ │ ├── app.yaml │ │ │ ├── routes.go │ │ │ ├── stripe.go │ │ │ └── templates/ │ │ │ └── index.gohtml │ │ └── 07_complete/ │ │ ├── app.yaml │ │ ├── routes.go │ │ ├── stripe.go │ │ └── templates/ │ │ └── index.gohtml │ ├── 66_authentication_OAUTH/ │ │ ├── 01_app-engine-auth_REVIEW/ │ │ │ ├── app.yaml │ │ │ └── main.go │ │ ├── 02_manual-auth/ │ │ │ ├── 01_cookie_REVIEW/ │ │ │ │ └── main.go │ │ │ ├── 02_gorilla_REVIEW_photo-blog/ │ │ │ │ ├── 01_simple/ │ │ │ │ │ └── main.go │ │ │ │ └── 02_photo-blog/ │ │ │ │ ├── assets/ │ │ │ │ │ └── templates/ │ │ │ │ │ ├── index.html │ │ │ │ │ └── login.html │ │ │ │ └── main.go │ │ │ ├── 03_memcache_REVIEW_twitter/ │ │ │ │ ├── README.txt │ │ │ │ ├── api.go │ │ │ │ ├── app.yaml │ │ │ │ ├── doc.go │ │ │ │ ├── email.go │ │ │ │ ├── following.go │ │ │ │ ├── index.yaml │ │ │ │ ├── main.go │ │ │ │ ├── model.go │ │ │ │ ├── public/ │ │ │ │ │ └── css/ │ │ │ │ │ ├── login.css │ │ │ │ │ ├── modal-tweet.css │ │ │ │ │ ├── reset.css │ │ │ │ │ ├── signup.css │ │ │ │ │ └── styles.css │ │ │ │ ├── session.go │ │ │ │ ├── template.go │ │ │ │ ├── templates/ │ │ │ │ │ └── html/ │ │ │ │ │ ├── follow.html │ │ │ │ │ ├── followingme.html │ │ │ │ │ ├── headersFooters.html │ │ │ │ │ ├── home.html │ │ │ │ │ ├── login.html │ │ │ │ │ ├── modal-tweet.html │ │ │ │ │ ├── signup.html │ │ │ │ │ └── user.html │ │ │ │ └── tweets.go │ │ │ └── 04_bcrypt/ │ │ │ ├── 01/ │ │ │ │ ├── README.txt │ │ │ │ └── main.go │ │ │ └── 02/ │ │ │ └── main.go │ │ ├── 03_oauth-github/ │ │ │ ├── 00_readme/ │ │ │ │ └── README.txt │ │ │ ├── 01_authorization-code/ │ │ │ │ ├── app.yaml │ │ │ │ ├── login.go │ │ │ │ └── session.go │ │ │ ├── 02_access-token/ │ │ │ │ ├── app.yaml │ │ │ │ ├── login.go │ │ │ │ └── session.go │ │ │ ├── 03_url-ParseQuery/ │ │ │ │ ├── app.yaml │ │ │ │ ├── login.go │ │ │ │ └── session.go │ │ │ ├── 04_user-email/ │ │ │ │ ├── app.yaml │ │ │ │ ├── login.go │ │ │ │ └── session.go │ │ │ ├── 05_configuration_scheduled-tasks_cron/ │ │ │ │ ├── app.yaml │ │ │ │ ├── cron.yaml │ │ │ │ ├── login.go │ │ │ │ └── scheduled.go │ │ │ └── 06-complete/ │ │ │ ├── app.yaml │ │ │ ├── cron.yaml │ │ │ ├── github.go │ │ │ ├── login.go │ │ │ ├── scheduled.go │ │ │ └── session.go │ │ ├── 04_oauth-twitter/ │ │ │ └── 00_readme/ │ │ │ └── README.txt │ │ ├── 05_oauth-facebook/ │ │ │ └── 00_readme/ │ │ │ └── README.txt │ │ ├── 05_oauth-google/ │ │ │ ├── 00_readme/ │ │ │ │ └── README.txt │ │ │ ├── app.yaml │ │ │ ├── routes.go │ │ │ └── session.go │ │ ├── 06_oauth-linkedin/ │ │ │ └── 00_readme/ │ │ │ └── README.txt │ │ ├── 07_oauth-vk/ │ │ │ └── 00_readme/ │ │ │ └── README.txt │ │ └── 08_oauth-dropbox/ │ │ ├── 00_readme/ │ │ │ └── README.txt │ │ ├── app.yaml │ │ ├── routes.go │ │ └── session.go │ ├── 67_digital-ocean_aerospike/ │ │ ├── 01_helloWorld/ │ │ │ └── testServer.go │ │ ├── 02_fullsite/ │ │ │ ├── .gitignore │ │ │ ├── main.go │ │ │ └── templates/ │ │ │ ├── create.gohtml │ │ │ ├── index.gohtml │ │ │ └── login.gohtml │ │ ├── 03-aerospike/ │ │ │ ├── main.go │ │ │ └── templates/ │ │ │ ├── create.gohtml │ │ │ ├── index.gohtml │ │ │ └── login.gohtml │ │ └── README.md │ ├── 68_task-queue/ │ │ ├── 01_delay/ │ │ │ ├── app.yaml │ │ │ ├── delayed.go │ │ │ └── routes.go │ │ ├── 02_delay-cron/ │ │ │ ├── app.yaml │ │ │ ├── cron.yaml │ │ │ ├── delayed.go │ │ │ ├── routes.go │ │ │ └── scheduled.go │ │ ├── 03_github/ │ │ │ ├── app.yaml │ │ │ ├── github.go │ │ │ ├── login.go │ │ │ └── session.go │ │ ├── 04_github-goroutines/ │ │ │ ├── app.yaml │ │ │ ├── github.go │ │ │ ├── login.go │ │ │ └── session.go │ │ └── 05_github-cron/ │ │ ├── app.yaml │ │ ├── cron.yaml │ │ ├── github.go │ │ ├── login.go │ │ ├── scheduled.go │ │ └── session.go │ ├── 90_append-to-file/ │ │ ├── 01-get-files/ │ │ │ └── main.go │ │ └── 02-apply/ │ │ └── main.go │ ├── 97_temp/ │ │ ├── 01/ │ │ │ └── main.go │ │ └── 02/ │ │ ├── 02 │ │ └── main.go │ ├── 98-good-student-code/ │ │ └── daniel/ │ │ ├── Week1/ │ │ │ ├── blog/ │ │ │ │ ├── blog.css │ │ │ │ └── blog.html │ │ │ ├── fullscreen/ │ │ │ │ ├── fullscreen-style.css │ │ │ │ └── fullscreen.html │ │ │ ├── google/ │ │ │ │ ├── google.css │ │ │ │ └── google.html │ │ │ └── treehouse/ │ │ │ ├── treehouse.css │ │ │ └── treehouse.html │ │ ├── Week10/ │ │ │ ├── dropbox-api/ │ │ │ │ ├── app.yaml │ │ │ │ ├── routes.go │ │ │ │ └── session.go │ │ │ ├── filebrowser/ │ │ │ │ ├── app.yaml │ │ │ │ ├── browse.go │ │ │ │ ├── credentials.go │ │ │ │ ├── public/ │ │ │ │ │ └── styles.css │ │ │ │ ├── routes.go │ │ │ │ ├── session.go │ │ │ │ ├── storage.go │ │ │ │ └── templates/ │ │ │ │ ├── browse.gohtml │ │ │ │ └── credentials.gohtml │ │ │ └── payment/ │ │ │ ├── app.yaml │ │ │ ├── routes.go │ │ │ ├── stripe.go │ │ │ └── templates/ │ │ │ └── index.gohtml │ │ ├── Week2/ │ │ │ ├── backgroundPreview/ │ │ │ │ ├── backgroundPreview.css │ │ │ │ ├── backgroundPreview.html │ │ │ │ └── backgroundPreview.js │ │ │ ├── changingBackground/ │ │ │ │ ├── changingBackground.css │ │ │ │ ├── changingBackground.html │ │ │ │ └── changingBackground.js │ │ │ ├── destructButton/ │ │ │ │ ├── destructButton.css │ │ │ │ ├── destructButton.html │ │ │ │ └── destructButton.js │ │ │ ├── generatedList/ │ │ │ │ ├── script.js │ │ │ │ └── test.html │ │ │ ├── imageListJavascript/ │ │ │ │ └── imageListJavascript.html │ │ │ ├── magic8ball/ │ │ │ │ ├── magic-ball.css │ │ │ │ ├── magic-ball.js │ │ │ │ └── magic8ball.html │ │ │ └── whackAMole/ │ │ │ ├── whackamole.css │ │ │ ├── whackamole.html │ │ │ └── whackamole.js │ │ ├── Week3/ │ │ │ ├── audioPlayer/ │ │ │ │ ├── audioPlayer.css │ │ │ │ ├── audioPlayer.html │ │ │ │ └── audioPlayer.js │ │ │ ├── hoverPreview/ │ │ │ │ ├── hoverPreview.css │ │ │ │ ├── hoverPreview.html │ │ │ │ └── hoverPreview.js │ │ │ └── loadImage/ │ │ │ ├── loadImage.css │ │ │ ├── loadImage.html │ │ │ └── loadImage.js │ │ ├── Week4/ │ │ │ ├── angularAjax/ │ │ │ │ ├── data.json │ │ │ │ ├── gulpfile.js │ │ │ │ ├── index.html │ │ │ │ └── script.js │ │ │ ├── chat/ │ │ │ │ └── chat.html │ │ │ ├── firebaseExample/ │ │ │ │ └── firebaseExample.html │ │ │ ├── flickrFeed/ │ │ │ │ ├── flickr.css │ │ │ │ ├── flickr.html │ │ │ │ ├── flickr.js │ │ │ │ ├── gulpfile.js │ │ │ │ └── package.json │ │ │ ├── liveSearch/ │ │ │ │ ├── data.json │ │ │ │ ├── gulpfile.js │ │ │ │ ├── liveSearch.css │ │ │ │ ├── liveSearch.html │ │ │ │ ├── liveSearch.js │ │ │ │ └── package.json │ │ │ ├── mustacheTemplate/ │ │ │ │ ├── data.json │ │ │ │ ├── gulpfile.js │ │ │ │ ├── mustache.html │ │ │ │ ├── mustache.js │ │ │ │ └── package.json │ │ │ └── routing/ │ │ │ ├── app.js │ │ │ ├── artists.js │ │ │ ├── detail.html │ │ │ ├── list.html │ │ │ ├── routing.html │ │ │ └── style.css │ │ ├── Week5/ │ │ │ └── web-components-training-exercises/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── breaking-shadow-dom-polyfill/ │ │ │ │ ├── another-component/ │ │ │ │ │ └── index.html │ │ │ │ ├── index.html │ │ │ │ ├── my-component/ │ │ │ │ │ └── index.html │ │ │ │ └── webcomponents.js │ │ │ ├── css-patterns-input-label-pairs/ │ │ │ │ └── index.html │ │ │ ├── css-patterns-media-object/ │ │ │ │ └── index.html │ │ │ ├── css-patterns-tabs/ │ │ │ │ └── index.html │ │ │ ├── general-components/ │ │ │ │ ├── hello-badge/ │ │ │ │ │ ├── index.html │ │ │ │ │ └── styles.css │ │ │ │ ├── readme.md │ │ │ │ ├── tabs/ │ │ │ │ │ └── index.html │ │ │ │ └── waiting-spinner/ │ │ │ │ ├── index.html │ │ │ │ └── styles.css │ │ │ ├── hello-web-components/ │ │ │ │ ├── index.html │ │ │ │ └── my-first-web-component/ │ │ │ │ └── my-first-web-component.html │ │ │ ├── intro-shadow-dom/ │ │ │ │ └── index.html │ │ │ ├── nesting-components/ │ │ │ │ ├── accordion_component/ │ │ │ │ │ ├── script.js │ │ │ │ │ └── styles.css │ │ │ │ └── index.html │ │ │ ├── progress-bar-component/ │ │ │ │ ├── index.html │ │ │ │ └── script.js │ │ │ ├── styleguide/ │ │ │ │ ├── components/ │ │ │ │ │ ├── accordion.html │ │ │ │ │ ├── badge.html │ │ │ │ │ ├── blink.html │ │ │ │ │ ├── button.html │ │ │ │ │ ├── slider.html │ │ │ │ │ └── spinner.html │ │ │ │ ├── createElement.js │ │ │ │ └── index.html │ │ │ └── ui-libraries/ │ │ │ ├── dogo-toolkit/ │ │ │ │ └── index.html │ │ │ └── jquery-ui/ │ │ │ └── index.html │ │ ├── Week6/ │ │ │ ├── 1-text-editors/ │ │ │ │ ├── 1-emmet.html │ │ │ │ └── 2-emmet.html │ │ │ ├── 2-browser-devtools/ │ │ │ │ ├── zlickr/ │ │ │ │ │ ├── css/ │ │ │ │ │ │ ├── gallery-grid.css │ │ │ │ │ │ ├── gallery.css │ │ │ │ │ │ └── pure.css │ │ │ │ │ └── index.html │ │ │ │ ├── zmail/ │ │ │ │ │ ├── css/ │ │ │ │ │ │ ├── email.css │ │ │ │ │ │ └── pure.css │ │ │ │ │ ├── index.html │ │ │ │ │ └── js/ │ │ │ │ │ ├── count.js │ │ │ │ │ ├── menu.js │ │ │ │ │ └── spam.js │ │ │ │ └── zordpress/ │ │ │ │ ├── css/ │ │ │ │ │ ├── blog.css │ │ │ │ │ ├── main-grid.css │ │ │ │ │ └── pure.css │ │ │ │ ├── index.html │ │ │ │ └── js/ │ │ │ │ └── save.js │ │ │ ├── 3-html5/ │ │ │ │ ├── 1-detection/ │ │ │ │ │ └── index.html │ │ │ │ ├── 2-structure/ │ │ │ │ │ ├── 1-past.html │ │ │ │ │ └── 2-today.html │ │ │ │ ├── 3-audio/ │ │ │ │ │ └── index.html │ │ │ │ ├── 4-video/ │ │ │ │ │ └── index.html │ │ │ │ ├── 5-input/ │ │ │ │ │ └── index.html │ │ │ │ ├── 6-mark/ │ │ │ │ │ └── index.html │ │ │ │ └── 7-progress/ │ │ │ │ └── index.html │ │ │ ├── 4-js/ │ │ │ │ ├── 1-jquery/ │ │ │ │ │ └── index.html │ │ │ │ ├── 2-audio/ │ │ │ │ │ └── index.html │ │ │ │ ├── 3-video/ │ │ │ │ │ └── index.html │ │ │ │ ├── 4-form/ │ │ │ │ │ └── index.html │ │ │ │ ├── 5-storage/ │ │ │ │ │ ├── local.html │ │ │ │ │ └── session.html │ │ │ │ ├── 6-geolocation/ │ │ │ │ │ └── index.html │ │ │ │ ├── 7-usermedia/ │ │ │ │ │ └── index.html │ │ │ │ ├── 8-dragndrop/ │ │ │ │ │ └── index.html │ │ │ │ └── 9-canvas/ │ │ │ │ └── index.html │ │ │ ├── 5-web-components/ │ │ │ │ ├── 0-proto/ │ │ │ │ │ └── index.html │ │ │ │ ├── 1-custom-elements/ │ │ │ │ │ ├── 1-index.html │ │ │ │ │ └── 2-fcc-location.html │ │ │ │ ├── 2-html-templates/ │ │ │ │ │ ├── 1-index.html │ │ │ │ │ ├── 2-fcc-logo.html │ │ │ │ │ └── 3-airport.html │ │ │ │ ├── 3-shadow-dom/ │ │ │ │ │ ├── 1-index.html │ │ │ │ │ └── 2-fcc-button.html │ │ │ │ └── 4-html-imports/ │ │ │ │ ├── 1-component.html │ │ │ │ ├── 1-index.html │ │ │ │ ├── 2-index.html │ │ │ │ └── 2-toc.html │ │ │ ├── 6-collapse/ │ │ │ │ ├── 2-index.html │ │ │ │ └── bower.json │ │ │ ├── 7-polymer/ │ │ │ │ ├── 1-registering/ │ │ │ │ │ ├── 1-index.html │ │ │ │ │ ├── 1-plain.html │ │ │ │ │ └── 1-polymer.html │ │ │ │ ├── 2-lifecycle/ │ │ │ │ │ ├── 1-index.html │ │ │ │ │ ├── 2-index.html │ │ │ │ │ ├── 2-plain.html │ │ │ │ │ └── 2-polymer.html │ │ │ │ ├── 3-properties/ │ │ │ │ │ ├── 1-index.html │ │ │ │ │ ├── 1-polymer.html │ │ │ │ │ ├── 2-index.html │ │ │ │ │ └── 2-polymer.html │ │ │ │ ├── 4-local-dom/ │ │ │ │ │ ├── 1-index.html │ │ │ │ │ ├── 1-polymer.html │ │ │ │ │ ├── 2-index.html │ │ │ │ │ └── 2-polymer.html │ │ │ │ └── 5-data-binding/ │ │ │ │ ├── 1-index.html │ │ │ │ ├── 1-polymer.html │ │ │ │ ├── 2-index.html │ │ │ │ └── 2-polymer.html │ │ │ └── 8-bonus/ │ │ │ ├── index.html │ │ │ └── style.html │ │ ├── Week7/ │ │ │ ├── Converter/ │ │ │ │ └── main.go │ │ │ ├── Hello/ │ │ │ │ └── main.go │ │ │ ├── Loops/ │ │ │ │ └── main.go │ │ │ ├── capitalize/ │ │ │ │ ├── main.go │ │ │ │ └── test.txt │ │ │ ├── distanceConverter/ │ │ │ │ └── main.go │ │ │ ├── findSmallest/ │ │ │ │ └── main.go │ │ │ ├── monuments/ │ │ │ │ ├── City_of_Champaign_GPS_Control_Points.csv │ │ │ │ ├── main.go │ │ │ │ └── test.html │ │ │ ├── my-cat/ │ │ │ │ ├── hello.txt │ │ │ │ └── main.go │ │ │ ├── my-md5/ │ │ │ │ └── main.go │ │ │ ├── profileGenerator/ │ │ │ │ └── main.go │ │ │ ├── rotate/ │ │ │ │ └── main.go │ │ │ ├── wordCount/ │ │ │ │ ├── main.go │ │ │ │ └── moby10b.txt │ │ │ └── yahooFinantial/ │ │ │ ├── info.html │ │ │ ├── main.go │ │ │ └── table.csv │ │ ├── Week8/ │ │ │ ├── chatRoom/ │ │ │ │ └── main.go │ │ │ ├── colors/ │ │ │ │ └── main.go │ │ │ ├── csv-convert/ │ │ │ │ ├── main.go │ │ │ │ └── table.csv │ │ │ ├── customHttpServer/ │ │ │ │ └── main.go │ │ │ ├── echoServer/ │ │ │ │ └── main.go │ │ │ ├── firstAppEngine/ │ │ │ │ ├── app.yaml │ │ │ │ └── hello.go │ │ │ ├── firstTemplate/ │ │ │ │ ├── main.go │ │ │ │ └── tpl.gohtml │ │ │ ├── formExample/ │ │ │ │ └── main.go │ │ │ ├── httpAnimals/ │ │ │ │ └── main.go │ │ │ ├── json-example/ │ │ │ │ ├── data.json │ │ │ │ └── main.go │ │ │ ├── photoBlog/ │ │ │ │ ├── adminSite.gohtml │ │ │ │ ├── app.yaml │ │ │ │ ├── main.go │ │ │ │ ├── mainSite.gohtml │ │ │ │ └── style.css │ │ │ ├── profile/ │ │ │ │ ├── app.yaml │ │ │ │ ├── createProfile.gohtml │ │ │ │ ├── main.go │ │ │ │ └── viewProfile.gohtml │ │ │ ├── redisDatabase/ │ │ │ │ └── main.go │ │ │ ├── secureHello/ │ │ │ │ └── main.go │ │ │ ├── static-http/ │ │ │ │ └── main.go │ │ │ ├── testExample/ │ │ │ │ ├── example.go │ │ │ │ └── example_test.go │ │ │ └── todolist/ │ │ │ ├── app.yaml │ │ │ ├── index.html │ │ │ ├── index.yaml │ │ │ ├── main.go │ │ │ ├── script.js │ │ │ └── style.css │ │ └── Week9/ │ │ ├── chat-example/ │ │ │ ├── app.yaml │ │ │ ├── handlers.go │ │ │ ├── public/ │ │ │ │ ├── index.html │ │ │ │ └── main.js │ │ │ └── routes.go │ │ ├── movie-search/ │ │ │ ├── app.yaml │ │ │ ├── data.go │ │ │ ├── details.go │ │ │ ├── index.go │ │ │ ├── index.yaml │ │ │ ├── movie.go │ │ │ ├── route.go │ │ │ ├── search.go │ │ │ ├── template.go │ │ │ └── templates/ │ │ │ ├── addMovie.gohtml │ │ │ ├── details.gohtml │ │ │ ├── header.gohtml │ │ │ ├── index.gohtml │ │ │ ├── movie.gohtml │ │ │ └── search.gohtml │ │ └── storageExample/ │ │ ├── app.yaml │ │ └── storage.go │ └── 99_svcc/ │ ├── 01_string-to-html/ │ │ └── main.go │ ├── 02_os-args/ │ │ └── main.go │ ├── 03_text-template/ │ │ ├── main.go │ │ └── tpl.gohtml │ ├── 04_pipeline/ │ │ ├── main.go │ │ └── tpl.gohtml │ ├── 05_pipeline-range/ │ │ ├── main.go │ │ └── tpl.gohtml │ ├── 06_pipeline-range-else/ │ │ ├── main.go │ │ └── tpl.gohtml │ ├── 07_composition/ │ │ ├── main.go │ │ └── tpl.gohtml │ ├── 08_composition-conditional/ │ │ ├── main.go │ │ └── tpl.gohtml │ ├── 09_methods/ │ │ └── main.go │ ├── 10_xss/ │ │ ├── index.html │ │ ├── main.go │ │ └── tpl.gohtml │ ├── 11_html-templates/ │ │ ├── index.html │ │ ├── main.go │ │ └── tpl.gohtml │ ├── 12_parsefiles/ │ │ ├── main.go │ │ ├── tpl.gohtml │ │ └── tpl2.gohtml │ ├── 13_ParseGlob/ │ │ ├── main.go │ │ └── templates/ │ │ ├── tpl.gohtml │ │ └── tpl2.gohtml │ ├── 14_tcp_echo-server/ │ │ └── main.go │ ├── 15_tcp_echo-server/ │ │ └── main.go │ ├── 16_redis-clone_step-2/ │ │ └── main.go │ ├── 17_redis-clone_step-5/ │ │ └── main.go │ ├── 18_rot13/ │ │ └── main.go │ ├── 19_DIY_http-server_request-line_headers/ │ │ └── main.go │ ├── 20_DIY_http-server_step-01/ │ │ └── main.go │ ├── 21_DIY_http-server_step-02/ │ │ └── main.go │ ├── 22_DIY_http-server_step-03/ │ │ └── main.go │ ├── 23_DIY_http-server_step-04/ │ │ └── main.go │ ├── 24_http-server_ServeMux/ │ │ └── main.go │ ├── 25_http-server_DefaultServeMux/ │ │ └── main.go │ ├── 26_serving-files_io-Copy/ │ │ └── main.go │ ├── 27_serving-files_ServeContent/ │ │ └── main.go │ ├── 28_serving-files_ServeFile/ │ │ └── main.go │ ├── 29_serving-files_FileServer/ │ │ └── main.go │ ├── 30_serving-files_FileServer/ │ │ └── main.go │ ├── 31_serving-files_FileServer/ │ │ └── main.go │ ├── 32_static-FileServer/ │ │ ├── assets/ │ │ │ ├── images/ │ │ │ │ └── home/ │ │ │ │ └── imgres.html │ │ │ └── stylesheets/ │ │ │ └── main.css │ │ ├── button.html │ │ ├── floats_in_practice.html │ │ ├── index.html │ │ ├── main.go │ │ ├── register.html │ │ ├── schedule.html │ │ ├── speakers.html │ │ ├── sponsors.html │ │ └── venue.html │ ├── 33_set-cookie/ │ │ └── main.go │ ├── 34_get-cookie/ │ │ └── main.go │ ├── 35_favicon-bye-bye/ │ │ └── main.go │ ├── 36_sessions_cookie/ │ │ └── main.go │ ├── 37_sessions_cookie_log-in-out/ │ │ └── main.go │ ├── 38_HMAC/ │ │ ├── 01/ │ │ │ └── main.go │ │ ├── 02/ │ │ │ └── main.go │ │ └── 03/ │ │ └── main.go │ ├── 39_AES-encrypt-decrypt/ │ │ └── main.go │ ├── 40_sessions_GORILLA/ │ │ └── main.go │ ├── 41_sessions_GORILLA_log-in-out/ │ │ └── main.go │ ├── 42_JSON/ │ │ └── main.go │ ├── 43_sessions_GORILLA_JSON/ │ │ └── main.go │ ├── 44_file-paths/ │ │ └── main.go │ ├── 45_sessions_GORILLA_photo-blog/ │ │ ├── assets/ │ │ │ └── templates/ │ │ │ ├── index.html │ │ │ └── login.html │ │ └── main.go │ └── 46_HTTPS-TLS/ │ └── main.go ├── LICENSE.txt └── README.md
Showing preview only (251K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2735 symbols across 965 files)
FILE: 01_getting-started/01_helloWorld/main.go
function main (line 5) | func main() {
FILE: 01_getting-started/02_numeral-systems/01_decimal/main.go
function main (line 5) | func main() {
FILE: 01_getting-started/02_numeral-systems/02_binary/main.go
function main (line 5) | func main() {
FILE: 01_getting-started/02_numeral-systems/03_hexadecimal/main.go
function main (line 5) | func main() {
FILE: 01_getting-started/02_numeral-systems/04_loop/main.go
function main (line 5) | func main() {
FILE: 01_getting-started/03_UTF-8/main.go
function main (line 5) | func main() {
FILE: 02_package/main/main.go
function main (line 10) | func main() {
FILE: 02_package/stringutil/reverse.go
function Reverse (line 5) | func Reverse(s string) string {
FILE: 02_package/stringutil/reverseTwo.go
function reverseTwo (line 3) | func reverseTwo(s string) string {
FILE: 03_variables/01_shorthand/01/main.go
function main (line 5) | func main() {
FILE: 03_variables/01_shorthand/02/main.go
function main (line 5) | func main() {
FILE: 03_variables/02_var_zero-value/main.go
function main (line 5) | func main() {
FILE: 03_variables/03_less-emphasis/01_declare-variable/var.go
function main (line 5) | func main() {
FILE: 03_variables/03_less-emphasis/02_declare-many-at-once/var.go
function main (line 5) | func main() {
FILE: 03_variables/03_less-emphasis/03_init-many-at-once/var.go
function main (line 5) | func main() {
FILE: 03_variables/03_less-emphasis/04_infer-type/var.go
function main (line 5) | func main() {
FILE: 03_variables/03_less-emphasis/05_infer-mixed-up-types/var.go
function main (line 5) | func main() {
FILE: 03_variables/03_less-emphasis/06_init-shorthand/var.go
function main (line 5) | func main() {
FILE: 03_variables/03_less-emphasis/07_all-together/variables.go
function main (line 9) | func main() {
FILE: 03_variables/03_less-emphasis/08_exercise_your-name/01_oneSolution/myNameVar.go
function main (line 7) | func main() {
FILE: 03_variables/03_less-emphasis/08_exercise_your-name/02_anotherSolution/myNameVar.go
function main (line 5) | func main() {
FILE: 03_variables/03_less-emphasis/08_exercise_your-name/03_anotherSolution/myNameVar.go
function main (line 5) | func main() {
FILE: 03_variables/03_less-emphasis/08_exercise_your-name/04_anotherSolution/myNameVar.go
function main (line 5) | func main() {
FILE: 04_scope/01_package-scope/01/main.go
function main (line 7) | func main() {
function foo (line 12) | func foo() {
FILE: 04_scope/01_package-scope/02_visibility/main/main.go
function main (line 8) | func main() {
FILE: 04_scope/01_package-scope/02_visibility/vis/printer.go
function PrintVar (line 6) | func PrintVar() {
FILE: 04_scope/02_block-scope/01_this-does-not-compile/main.go
function main (line 5) | func main() {
function foo (line 11) | func foo() {
FILE: 04_scope/02_block-scope/02_closure/01/main.go
function main (line 5) | func main() {
FILE: 04_scope/02_block-scope/02_closure/02/main.go
function increment (line 7) | func increment() int {
function main (line 12) | func main() {
FILE: 04_scope/02_block-scope/02_closure/03/main.go
function main (line 5) | func main() {
FILE: 04_scope/02_block-scope/02_closure/04/main.go
function wrapper (line 5) | func wrapper() func() int {
function main (line 13) | func main() {
FILE: 04_scope/03_order-matters/main.go
function main (line 5) | func main() {
FILE: 04_scope/04_variable-shadowing/main.go
function max (line 5) | func max(x int) int {
function main (line 9) | func main() {
FILE: 04_scope/05_same-package/main.go
function main (line 5) | func main() {
FILE: 05_blank-identifier/01_invalid-code/main.go
function main (line 5) | func main() {
FILE: 05_blank-identifier/02_http-get_example/01_with-error-checking/main.go
function main (line 10) | func main() {
FILE: 05_blank-identifier/02_http-get_example/02_no-error-checking/main.go
function main (line 9) | func main() {
FILE: 06_constants/01_constant/main.go
constant p (line 5) | p = "death & taxes"
function main (line 7) | func main() {
FILE: 06_constants/02_multiple-initialization/main.go
constant pi (line 6) | pi = 3.14
constant language (line 7) | language = "Go"
function main (line 10) | func main() {
FILE: 06_constants/03_iota/main.go
constant a (line 6) | a = iota
constant b (line 7) | b = iota
constant c (line 8) | c = iota
function main (line 11) | func main() {
FILE: 06_constants/04_iota/main.go
constant a (line 6) | a = iota
constant b (line 7) | b
constant c (line 8) | c
function main (line 11) | func main() {
FILE: 06_constants/05_iota/main.go
constant a (line 6) | a = iota
constant b (line 7) | b
constant c (line 8) | c
constant d (line 12) | d = iota
constant e (line 13) | e
constant f (line 14) | f
function main (line 17) | func main() {
FILE: 06_constants/06_iota/main.go
constant _ (line 6) | _ = iota
constant b (line 7) | b = iota * 10
constant c (line 8) | c = iota * 10
function main (line 11) | func main() {
FILE: 06_constants/07_iota/main.go
constant _ (line 6) | _ = iota
constant KB (line 7) | KB = 1 << (iota * 10)
constant MB (line 8) | MB = 1 << (iota * 10)
constant GB (line 9) | GB = 1 << (iota * 10)
constant TB (line 10) | TB = 1 << (iota * 10)
function main (line 13) | func main() {
FILE: 07_memory-address/01_showing-address/main.go
function main (line 5) | func main() {
FILE: 07_memory-address/02_using-address/main.go
constant metersToYards (line 5) | metersToYards float64 = 1.09361
function main (line 7) | func main() {
FILE: 08_pointers/01_referencing/main.go
function main (line 7) | func main() {
FILE: 08_pointers/02_dereferencing/main.go
function main (line 5) | func main() {
FILE: 08_pointers/03_using-pointers/main.go
function main (line 5) | func main() {
FILE: 08_pointers/04_using-pointers/01_no-pointer/01/main.go
function zero (line 5) | func zero(z int) {
function main (line 9) | func main() {
FILE: 08_pointers/04_using-pointers/01_no-pointer/02_see-the-addresses/main.go
function zero (line 5) | func zero(z int) {
function main (line 11) | func main() {
FILE: 08_pointers/04_using-pointers/02_pointer/01/main.go
function zero (line 5) | func zero(z *int) {
function main (line 9) | func main() {
FILE: 08_pointers/04_using-pointers/02_pointer/02_see-the-addresses/main.go
function zero (line 5) | func zero(z *int) {
function main (line 10) | func main() {
FILE: 09_remainder/main.go
function main (line 5) | func main() {
FILE: 10_for-loop/01_init-condition-post/main.go
function main (line 5) | func main() {
FILE: 10_for-loop/02_nested/main.go
function main (line 5) | func main() {
FILE: 10_for-loop/03_for-condition-while-ish/main.go
function main (line 5) | func main() {
FILE: 10_for-loop/04_for_no-condition/main.go
function main (line 5) | func main() {
FILE: 10_for-loop/05_for_break/main.go
function main (line 5) | func main() {
FILE: 10_for-loop/06_for_continue/main.go
function main (line 5) | func main() {
FILE: 10_for-loop/07_rune-loop_UTF8/01/main.go
function main (line 5) | func main() {
FILE: 10_for-loop/07_rune-loop_UTF8/02/main.go
function main (line 5) | func main() {
FILE: 11_switch-statements/01_switch/main.go
function main (line 5) | func main() {
FILE: 11_switch-statements/02_fallthrough/main.go
function main (line 5) | func main() {
FILE: 11_switch-statements/03_multiple-evals/main.go
function main (line 5) | func main() {
FILE: 11_switch-statements/04_no-expression/main.go
function main (line 5) | func main() {
FILE: 11_switch-statements/05_on-type/type.go
type contact (line 9) | type contact struct
function SwitchOnType (line 16) | func SwitchOnType(x interface{}) {
function main (line 30) | func main() {
FILE: 12_if_else-if_else/01_eval-true/main.go
function main (line 5) | func main() {
FILE: 12_if_else-if_else/02_not-exclamation/main.go
function main (line 5) | func main() {
FILE: 12_if_else-if_else/03_init-statement/main.go
function main (line 5) | func main() {
FILE: 12_if_else-if_else/04_init-statement_error_invalid-code/main.go
function main (line 5) | func main() {
FILE: 12_if_else-if_else/05_if-else/main.go
function main (line 5) | func main() {
FILE: 12_if_else-if_else/06_if-elseif-else/main.go
function main (line 5) | func main() {
FILE: 12_if_else-if_else/07_if-elseif-elseif-else/main.go
function main (line 5) | func main() {
FILE: 12_if_else-if_else/08_divisibleByThree/main.go
function main (line 5) | func main() {
FILE: 13_exercise-solutions/01_hello-world/main.go
function main (line 5) | func main() {
FILE: 13_exercise-solutions/02_hello-NAME/main.go
function main (line 5) | func main() {
FILE: 13_exercise-solutions/03_hello-user-input/main.go
function main (line 5) | func main() {
FILE: 13_exercise-solutions/04_user-enters-numbers/main.go
function main (line 5) | func main() {
FILE: 13_exercise-solutions/05_even-numbers/main.go
function main (line 5) | func main() {
FILE: 13_exercise-solutions/06_fizzBuzz/main.go
function main (line 5) | func main() {
FILE: 13_exercise-solutions/07_threeFive/main.go
function main (line 5) | func main() {
FILE: 13_exercise-solutions/08_just-fyi/01_benchMark/bm_test.go
function BenchmarkHello (line 8) | func BenchmarkHello(b *testing.B) {
FILE: 13_exercise-solutions/08_just-fyi/02_benchMark/bm_test.go
function BenchmarkHello (line 8) | func BenchmarkHello(b *testing.B) {
FILE: 13_exercise-solutions/08_just-fyi/03_utf/main.go
function main (line 5) | func main() {
FILE: 14_functions/01_main/main.go
function main (line 5) | func main() {
FILE: 14_functions/02_param-arg/main.go
function main (line 5) | func main() {
function greet (line 10) | func greet(name string) {
FILE: 14_functions/03_two-params/01/main.go
function main (line 5) | func main() {
function greet (line 9) | func greet(fname string, lname string) {
FILE: 14_functions/03_two-params/02/main.go
function main (line 5) | func main() {
function greet (line 9) | func greet(fname, lname string) {
FILE: 14_functions/04_return/main.go
function main (line 5) | func main() {
function greet (line 9) | func greet(fname, lname string) string {
FILE: 14_functions/05_return-naming/main.go
function main (line 5) | func main() {
function greet (line 9) | func greet(fname string, lname string) (s string) {
FILE: 14_functions/06_return-multiple/main.go
function main (line 5) | func main() {
function greet (line 9) | func greet(fname, lname string) (string, string) {
FILE: 14_functions/07_variadic-params/main.go
function main (line 5) | func main() {
function average (line 10) | func average(sf ...float64) float64 {
FILE: 14_functions/08_variadic-args/main.go
function main (line 5) | func main() {
function average (line 11) | func average(sf ...float64) float64 {
FILE: 14_functions/09_slice-param-arg/main.go
function main (line 5) | func main() {
function average (line 11) | func average(sf []float64) float64 {
FILE: 14_functions/10_func-expression/01_before-func-expression/main.go
function greeting (line 5) | func greeting() {
function main (line 9) | func main() {
FILE: 14_functions/10_func-expression/02_func-expression/main.go
function main (line 5) | func main() {
FILE: 14_functions/10_func-expression/03_func-expression_shows-type/main.go
function main (line 5) | func main() {
FILE: 14_functions/10_func-expression/04_another-way_func-expression/main.go
function makeGreeter (line 5) | func makeGreeter() func() string {
function main (line 11) | func main() {
FILE: 14_functions/10_func-expression/05_another-way_func-expression_shows-type/main.go
function makeGreeter (line 5) | func makeGreeter() func() string {
function main (line 11) | func main() {
FILE: 14_functions/11_closure/01/main.go
function main (line 5) | func main() {
FILE: 14_functions/11_closure/02/main.go
function increment (line 7) | func increment() int {
function main (line 12) | func main() {
FILE: 14_functions/11_closure/03/main.go
function main (line 5) | func main() {
FILE: 14_functions/11_closure/04/main.go
function wrapper (line 5) | func wrapper() func() int {
function main (line 13) | func main() {
FILE: 14_functions/11_closure/05/main.go
function wrapper (line 5) | func wrapper() func() int {
function main (line 13) | func main() {
FILE: 14_functions/12_callbacks/01_print-nums/main.go
function visit (line 5) | func visit(numbers []int, callback func(int)) {
function main (line 11) | func main() {
FILE: 14_functions/12_callbacks/02_filter-nums/main.go
function filter (line 5) | func filter(numbers []int, callback func(int) bool) []int {
function main (line 15) | func main() {
FILE: 14_functions/13_recursion/main.go
function factorial (line 5) | func factorial(x int) int {
function main (line 12) | func main() {
FILE: 14_functions/14_defer/01_no-defer/main.go
function hello (line 5) | func hello() {
function world (line 9) | func world() {
function main (line 13) | func main() {
FILE: 14_functions/14_defer/02_with-defer/main.go
function hello (line 5) | func hello() {
function world (line 9) | func world() {
function main (line 13) | func main() {
FILE: 14_functions/15_passing-by-value/01_int/main.go
function main (line 5) | func main() {
function changeMe (line 11) | func changeMe(z int) {
FILE: 14_functions/15_passing-by-value/02_int-pointer/main.go
function main (line 5) | func main() {
function changeMe (line 16) | func changeMe(z *int) {
FILE: 14_functions/15_passing-by-value/03_string/main.go
function main (line 5) | func main() {
function changeMe (line 15) | func changeMe(z string) {
FILE: 14_functions/15_passing-by-value/04_string-pointer/main.go
function main (line 5) | func main() {
function changeMe (line 16) | func changeMe(z *string) {
FILE: 14_functions/15_passing-by-value/05_REFERENCE-TYPE/main.go
function main (line 5) | func main() {
function changeMe (line 11) | func changeMe(z map[string]int) {
FILE: 14_functions/15_passing-by-value/06_REFERENCE-TYPE/main.go
function main (line 5) | func main() {
function changeMe (line 12) | func changeMe(z []string) {
FILE: 14_functions/15_passing-by-value/07_struct-pointer/main.go
type customer (line 5) | type customer struct
function main (line 10) | func main() {
function changeMe (line 20) | func changeMe(z *customer) {
FILE: 14_functions/16_anon_self-executing/main.go
function main (line 5) | func main() {
FILE: 15_bool-expressions/01_true-false/main.go
function main (line 5) | func main() {
FILE: 15_bool-expressions/02_not/main.go
function main (line 5) | func main() {
FILE: 15_bool-expressions/03_or/main.go
function main (line 5) | func main() {
FILE: 15_bool-expressions/04_and/main.go
function main (line 5) | func main() {
FILE: 16_exercise-solutions/01_half/01/main.go
function half (line 5) | func half(n int) (int, bool) {
function main (line 9) | func main() {
FILE: 16_exercise-solutions/01_half/02/main.go
function half (line 5) | func half(n int) (float64, bool) {
function main (line 9) | func main() {
FILE: 16_exercise-solutions/02_func-expression/main.go
function main (line 5) | func main() {
FILE: 16_exercise-solutions/03_variadic-greatest/main.go
function max (line 5) | func max(numbers ...int) int {
function main (line 15) | func main() {
FILE: 16_exercise-solutions/04_bool-expression/main.go
function main (line 5) | func main() {
FILE: 16_exercise-solutions/05_params-and-args/main.go
function main (line 5) | func main() {
function foo (line 13) | func foo(numbers ...int) {
FILE: 17_array/01/main.go
function main (line 5) | func main() {
FILE: 17_array/02/main.go
function main (line 5) | func main() {
FILE: 17_array/03/main.go
function main (line 5) | func main() {
FILE: 17_array/04/main.go
function main (line 5) | func main() {
FILE: 17_array/05/main.go
function main (line 5) | func main() {
FILE: 18_slice/01_int-slice/main.go
function main (line 5) | func main() {
FILE: 18_slice/02_int-slice/main.go
function main (line 5) | func main() {
FILE: 18_slice/03_int-slice/main.go
function main (line 5) | func main() {
FILE: 18_slice/04_string-slice/main.go
function main (line 5) | func main() {
FILE: 18_slice/05_slicing-a-slice/01/main.go
function main (line 5) | func main() {
FILE: 18_slice/05_slicing-a-slice/02/main.go
function main (line 5) | func main() {
FILE: 18_slice/06_make/main.go
function main (line 5) | func main() {
FILE: 18_slice/07_append-invalid/main.go
function main (line 5) | func main() {
FILE: 18_slice/08_append/main.go
function main (line 5) | func main() {
FILE: 18_slice/09_append-beyond-capacity/main.go
function main (line 5) | func main() {
FILE: 18_slice/10_append_slice-to-slice/01_slice-of-ints/main.go
function main (line 5) | func main() {
FILE: 18_slice/10_append_slice-to-slice/02_slice-of-strings/main.go
function main (line 5) | func main() {
FILE: 18_slice/11_delete/main.go
function main (line 5) | func main() {
FILE: 18_slice/12_multi-dimensional/01_shorthand-slice/main.go
function main (line 7) | func main() {
FILE: 18_slice/12_multi-dimensional/02_var-slice/main.go
function main (line 7) | func main() {
FILE: 18_slice/12_multi-dimensional/03_make-slice/main.go
function main (line 7) | func main() {
FILE: 18_slice/12_multi-dimensional/04_comparing_shorthand_var_make/01_shorthand-slice/main.go
function main (line 7) | func main() {
FILE: 18_slice/12_multi-dimensional/04_comparing_shorthand_var_make/02_var-slice/main.go
function main (line 7) | func main() {
FILE: 18_slice/12_multi-dimensional/04_comparing_shorthand_var_make/03_make-slice/main.go
function main (line 7) | func main() {
FILE: 18_slice/12_multi-dimensional/05_slice-of-slice-of-string/main.go
function main (line 7) | func main() {
FILE: 18_slice/12_multi-dimensional/06_slice-of-slice-of-int/main.go
function main (line 7) | func main() {
FILE: 18_slice/13_int-slice-plus-plus/main.go
function main (line 5) | func main() {
FILE: 19_map/01_var_nil-map/main.go
function main (line 5) | func main() {
FILE: 19_map/02_var_make/main.go
function main (line 5) | func main() {
FILE: 19_map/03_shorthand_make/main.go
function main (line 5) | func main() {
FILE: 19_map/04_shorthand_composite-literal/main.go
function main (line 5) | func main() {
FILE: 19_map/05_shorthand_composite-literal/main.go
function main (line 5) | func main() {
FILE: 19_map/06_adding-entry/main.go
function main (line 5) | func main() {
FILE: 19_map/07_len/main.go
function main (line 5) | func main() {
FILE: 19_map/08_updating-entry/main.go
function main (line 5) | func main() {
FILE: 19_map/09_deleting-entry/main.go
function main (line 5) | func main() {
FILE: 19_map/10_comma-ok-idiom_val-exists/main.go
function main (line 5) | func main() {
FILE: 19_map/11_deleting-entry_no-error/main.go
function main (line 5) | func main() {
FILE: 19_map/12_comma-ok-idiom_val-not-exists/main.go
function main (line 5) | func main() {
FILE: 19_map/13_loop-range/main.go
function main (line 5) | func main() {
FILE: 19_map/14_hash-table/01_letter-buckets/01_runes-are-numbers/main.go
function main (line 5) | func main() {
FILE: 19_map/14_hash-table/01_letter-buckets/02_strings-to-rune-conversion/main.go
function main (line 5) | func main() {
FILE: 19_map/14_hash-table/01_letter-buckets/03_string-index-access/main.go
function main (line 5) | func main() {
FILE: 19_map/14_hash-table/01_letter-buckets/04_remainder-bucket-selection/main.go
function main (line 5) | func main() {
FILE: 19_map/14_hash-table/01_letter-buckets/05_hash-function/main.go
function main (line 5) | func main() {
function hashBucket (line 10) | func hashBucket(word string, buckets int) int {
FILE: 19_map/14_hash-table/01_letter-buckets/06_get/main.go
function main (line 10) | func main() {
FILE: 19_map/14_hash-table/01_letter-buckets/07_scanner/main.go
function main (line 10) | func main() {
FILE: 19_map/14_hash-table/01_letter-buckets/08_moby-dicks-words/main.go
function main (line 10) | func main() {
FILE: 19_map/14_hash-table/01_letter-buckets/09_int-slice-plus-plus/main.go
function main (line 5) | func main() {
FILE: 19_map/14_hash-table/01_letter-buckets/10_hash-letter-buckets/main.go
function main (line 10) | func main() {
function hashBucket (line 36) | func hashBucket(word string) int {
FILE: 19_map/14_hash-table/01_letter-buckets/11_hash-remainder-buckets/main.go
function main (line 10) | func main() {
function hashBucket (line 32) | func hashBucket(word string, buckets int) int {
FILE: 19_map/14_hash-table/02_even-dstribution-hash/main.go
function main (line 10) | func main() {
function hashBucket (line 32) | func hashBucket(word string, buckets int) int {
FILE: 19_map/14_hash-table/03_words-in-buckets/01_slice-bucket/main.go
function main (line 10) | func main() {
function hashBucket (line 44) | func hashBucket(word string, buckets int) int {
FILE: 19_map/14_hash-table/03_words-in-buckets/02_map-bucket/main.go
function main (line 10) | func main() {
function hashBucket (line 43) | func hashBucket(word string, buckets int) int {
FILE: 19_map/14_hash-table/04_english-alphabet/01/main.go
function main (line 10) | func main() {
FILE: 19_map/14_hash-table/04_english-alphabet/02/main.go
function main (line 11) | func main() {
FILE: 20_struct/01_user-defined-types/01_alias-type_not-idiomatic/main.go
type foo (line 5) | type foo
function main (line 7) | func main() {
FILE: 20_struct/01_user-defined-types/02_static-typing/main.go
type foo (line 5) | type foo
function main (line 7) | func main() {
FILE: 20_struct/02_struct_fields_values_initialization/main.go
type person (line 5) | type person struct
function main (line 11) | func main() {
FILE: 20_struct/03_methods/main.go
type person (line 5) | type person struct
method fullName (line 11) | func (p person) fullName() string {
function main (line 15) | func main() {
FILE: 20_struct/04_embedded-types/main.go
type person (line 7) | type person struct
type doubleZero (line 13) | type doubleZero struct
function main (line 18) | func main() {
FILE: 20_struct/05_promotion/01_overriding-fields/main.go
type person (line 7) | type person struct
type doubleZero (line 13) | type doubleZero struct
function main (line 19) | func main() {
FILE: 20_struct/05_promotion/02_overriding-methods/main.go
type person (line 7) | type person struct
method Greeting (line 17) | func (p person) Greeting() {
type doubleZero (line 12) | type doubleZero struct
method Greeting (line 21) | func (dz doubleZero) Greeting() {
function main (line 25) | func main() {
FILE: 20_struct/06_struct-pointer/main.go
type person (line 5) | type person struct
function main (line 10) | func main() {
FILE: 20_struct/07_marshal_unmarshal/01_marshal/01_exported/main.go
type person (line 8) | type person struct
function main (line 15) | func main() {
FILE: 20_struct/07_marshal_unmarshal/01_marshal/02_unexported/main.go
type person (line 8) | type person struct
function main (line 14) | func main() {
FILE: 20_struct/07_marshal_unmarshal/01_marshal/03_tags/main.go
type person (line 8) | type person struct
function main (line 14) | func main() {
FILE: 20_struct/07_marshal_unmarshal/02_unmarshal/01/main.go
type person (line 8) | type person struct
function main (line 14) | func main() {
FILE: 20_struct/07_marshal_unmarshal/02_unmarshal/02_tags/main.go
type person (line 8) | type person struct
function main (line 14) | func main() {
FILE: 20_struct/08_encode_decode/01_encode/main.go
type person (line 8) | type person struct
function main (line 15) | func main() {
FILE: 20_struct/08_encode_decode/02_decode/main.go
type person (line 9) | type person struct
function main (line 16) | func main() {
FILE: 21_interfaces/01_interface/01_no-interface/main.go
type square (line 5) | type square struct
method area (line 9) | func (z square) area() float64 {
function main (line 13) | func main() {
FILE: 21_interfaces/01_interface/02_interface/main.go
type square (line 5) | type square struct
method area (line 9) | func (z square) area() float64 {
type shape (line 13) | type shape interface
function info (line 17) | func info(z shape) {
function main (line 22) | func main() {
FILE: 21_interfaces/01_interface/03_interface/main.go
type square (line 8) | type square struct
method area (line 21) | func (s square) area() float64 {
type circle (line 13) | type circle struct
method area (line 26) | func (c circle) area() float64 {
type shape (line 17) | type shape interface
function info (line 30) | func info(z shape) {
function main (line 35) | func main() {
FILE: 21_interfaces/01_interface/04_interface/main.go
type circle (line 8) | type circle struct
method area (line 20) | func (c circle) area() float64 {
type square (line 12) | type square struct
method area (line 24) | func (s square) area() float64 {
type shape (line 16) | type shape interface
function info (line 28) | func info(z shape) {
function totalArea (line 34) | func totalArea(shapes ...shape) float64 {
function main (line 42) | func main() {
FILE: 21_interfaces/01_interface/05_io-copy/01_no-error-checking/main.go
function main (line 11) | func main() {
FILE: 21_interfaces/01_interface/05_io-copy/02_error-checking/main.go
function main (line 12) | func main() {
FILE: 21_interfaces/02_package-sort/01_sort-names/main.go
type people (line 8) | type people
method Len (line 10) | func (p people) Len() int { return len(p) }
method Swap (line 11) | func (p people) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
method Less (line 12) | func (p people) Less(i, j int) bool { return p[i] < p[j] }
function main (line 14) | func main() {
FILE: 21_interfaces/02_package-sort/02_sort-names_type-StringSlice/main.go
function main (line 8) | func main() {
FILE: 21_interfaces/02_package-sort/03_sort-Strings/main.go
function main (line 8) | func main() {
FILE: 21_interfaces/02_package-sort/04_sort-names_type-StringSlice_reverse/main.go
function main (line 8) | func main() {
FILE: 21_interfaces/02_package-sort/05_sort-int_type-IntSlice/main.go
function main (line 8) | func main() {
FILE: 21_interfaces/02_package-sort/06_sort-int_type-IntSlice_reverse/main.go
function main (line 8) | func main() {
FILE: 21_interfaces/02_package-sort/07_sort-Ints/main.go
function main (line 8) | func main() {
FILE: 21_interfaces/02_package-sort/08_standard-library-example/main.go
type person (line 8) | type person struct
method String (line 13) | func (p person) String() string {
type ByAge (line 19) | type ByAge
method Len (line 21) | func (a ByAge) Len() int { return len(a) }
method Swap (line 22) | func (a ByAge) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
method Less (line 23) | func (a ByAge) Less(i, j int) bool { return a[i].Age < a[j].Age }
function main (line 27) | func main() {
FILE: 21_interfaces/03_empty-interface/01_no-interface/main.go
type vehicle (line 5) | type vehicle struct
type car (line 11) | type car struct
type plane (line 17) | type plane struct
type boat (line 22) | type boat struct
function main (line 27) | func main() {
FILE: 21_interfaces/03_empty-interface/02_empty-interface/main.go
type vehicles (line 5) | type vehicles interface
type vehicle (line 7) | type vehicle struct
type car (line 13) | type car struct
type plane (line 19) | type plane struct
type boat (line 24) | type boat struct
function main (line 29) | func main() {
FILE: 21_interfaces/03_empty-interface/03_param-accepts-any-type/main.go
type animal (line 5) | type animal struct
type dog (line 9) | type dog struct
type cat (line 14) | type cat struct
function specs (line 19) | func specs(a interface{}) {
function main (line 23) | func main() {
FILE: 21_interfaces/03_empty-interface/04_slice-of-any-type/main.go
type animal (line 5) | type animal struct
type dog (line 9) | type dog struct
type cat (line 14) | type cat struct
function main (line 19) | func main() {
FILE: 21_interfaces/04_method-sets/01_value-receiver_value-type/main.go
type circle (line 8) | type circle struct
method area (line 16) | func (c circle) area() float64 {
type shape (line 12) | type shape interface
function info (line 20) | func info(s shape) {
function main (line 24) | func main() {
FILE: 21_interfaces/04_method-sets/02_value-receiver_pointer-type/main.go
type circle (line 8) | type circle struct
method area (line 16) | func (c circle) area() float64 {
type shape (line 12) | type shape interface
function info (line 20) | func info(s shape) {
function main (line 24) | func main() {
FILE: 21_interfaces/04_method-sets/03_pointer-receiver_pointer-type/main.go
type circle (line 8) | type circle struct
method area (line 16) | func (c *circle) area() float64 {
type shape (line 12) | type shape interface
function info (line 20) | func info(s shape) {
function main (line 24) | func main() {
FILE: 21_interfaces/04_method-sets/04_pointer-receiver_value-type/main.go
type circle (line 8) | type circle struct
method area (line 16) | func (c *circle) area() float64 {
type shape (line 12) | type shape interface
function info (line 20) | func info(s shape) {
function main (line 24) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/01_int-to-float/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/02_float-to-int/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/03_rune-to-string/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/04_rune-to-slice-of-bytes-to-string/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/05_string-to-slice-of-bytes/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/06_strconv/01_Atoi/main.go
function main (line 8) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/06_strconv/02_Itoa/main.go
function main (line 8) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/01_conversion/06_strconv/03_ParseInt/main.go
function main (line 8) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/01_non-interface-error_invalid-code/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/02_interface-string/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/03_interface-string_not-ok/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/04_interface-int_print-type/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/05_interface-int_mistmatched-types-error/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/06_interface-int-sum/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/07_casting-reminder/main.go
function main (line 5) | func main() {
FILE: 21_interfaces/05_conversion-vs-assertion/02_assertion/08_interface-cast-error_need-type-assertion/main.go
function main (line 5) | func main() {
FILE: 22_go-routines/01_no-go/main.go
function main (line 5) | func main() {
function foo (line 10) | func foo() {
function bar (line 16) | func bar() {
FILE: 22_go-routines/02_go_concurrency/main.go
function main (line 5) | func main() {
function foo (line 10) | func foo() {
function bar (line 16) | func bar() {
FILE: 22_go-routines/03_wait-group/main.go
function main (line 10) | func main() {
function foo (line 17) | func foo() {
function bar (line 24) | func bar() {
FILE: 22_go-routines/04_time-sleep/main.go
function main (line 11) | func main() {
function foo (line 18) | func foo() {
function bar (line 26) | func bar() {
FILE: 22_go-routines/05_gomaxprocs_parallelism/main.go
function init (line 12) | func init() {
function main (line 16) | func main() {
function foo (line 23) | func foo() {
function bar (line 31) | func bar() {
FILE: 22_go-routines/06_race-condition/main.go
function main (line 13) | func main() {
function incrementor (line 21) | func incrementor(s string) {
FILE: 22_go-routines/07_mutex/main.go
function main (line 14) | func main() {
function incrementor (line 22) | func incrementor(s string) {
FILE: 22_go-routines/08_atomicity/main.go
function main (line 14) | func main() {
function incrementor (line 22) | func incrementor(s string) {
FILE: 22_go-routines/09_channels/00_unbuffered-channels-block/main.go
function main (line 8) | func main() {
FILE: 22_go-routines/09_channels/01_range/main.go
function main (line 7) | func main() {
FILE: 22_go-routines/09_channels/02_n-to-1/01_race-condition/main.go
function main (line 8) | func main() {
FILE: 22_go-routines/09_channels/02_n-to-1/02_wait-group/main.go
function main (line 8) | func main() {
FILE: 22_go-routines/09_channels/02_n-to-1/03_semaphore/main.go
function main (line 7) | func main() {
FILE: 22_go-routines/09_channels/02_n-to-1/04_semaphore_wrong-way/main.go
function main (line 7) | func main() {
FILE: 22_go-routines/09_channels/02_n-to-1/05_n-times_to_1/main.go
function main (line 7) | func main() {
FILE: 22_go-routines/09_channels/03_1-to-n/01_1_to_2-times/main.go
function main (line 7) | func main() {
FILE: 22_go-routines/09_channels/03_1-to-n/02_1_to_n-times/main.go
function main (line 7) | func main() {
FILE: 22_go-routines/09_channels/04_pass-return-channels/main.go
function main (line 5) | func main() {
function incrementor (line 13) | func incrementor() chan int {
function puller (line 24) | func puller(c chan int) chan int {
FILE: 22_go-routines/09_channels/05_channel-direction/main.go
function main (line 5) | func main() {
function incrementor (line 13) | func incrementor() <-chan int {
function puller (line 24) | func puller(c <-chan int) <-chan int {
FILE: 22_go-routines/09_channels/06_refactor/main.go
function main (line 5) | func main() {
function incrementor (line 12) | func incrementor() <-chan int {
function puller (line 23) | func puller(c <-chan int) <-chan int {
FILE: 22_go-routines/09_channels/07_incrementor/main.go
function main (line 7) | func main() {
function incrementor (line 15) | func incrementor(s string) chan int {
function puller (line 27) | func puller(c chan int) chan int {
FILE: 22_go-routines/09_channels/08_closures/01_no-closure-binding/main.go
function main (line 5) | func main() {
FILE: 22_go-routines/09_channels/08_closures/02_closure-binding/main.go
function main (line 5) | func main() {
FILE: 22_go-routines/09_channels/08_closures/03_closure-binding/main.go
function main (line 5) | func main() {
FILE: 22_go-routines/10_deadlock-challenges/01_deadlock-challenge/main.go
function main (line 7) | func main() {
FILE: 22_go-routines/10_deadlock-challenges/02_deadlock-solution/main.go
function main (line 7) | func main() {
FILE: 22_go-routines/10_deadlock-challenges/03_deadlock-challenge/main.go
function main (line 7) | func main() {
FILE: 22_go-routines/10_deadlock-challenges/04_deadlock-challenge/main.go
function main (line 7) | func main() {
FILE: 22_go-routines/10_deadlock-challenges/05_deadlock-solution/main.go
function main (line 7) | func main() {
FILE: 22_go-routines/11_factorial-challenge/01_challenge-description/main.go
function main (line 7) | func main() {
function factorial (line 12) | func factorial(n int) int {
FILE: 22_go-routines/11_factorial-challenge/02_challenge-solution/main.go
function main (line 7) | func main() {
function factorial (line 14) | func factorial(n int) chan int {
FILE: 22_go-routines/12_channels_pipeline/01_sq-output/main.go
function main (line 5) | func main() {
function gen (line 15) | func gen(nums ...int) chan int {
function sq (line 26) | func sq(in chan int) chan int {
FILE: 22_go-routines/12_channels_pipeline/02_sq-output/main.go
function main (line 5) | func main() {
function gen (line 12) | func gen(nums ...int) chan int {
function sq (line 23) | func sq(in chan int) chan int {
FILE: 22_go-routines/12_channels_pipeline/03_challenge-description/main.go
function main (line 7) | func main() {
function factorial (line 14) | func factorial(n int) chan int {
FILE: 22_go-routines/12_channels_pipeline/04_challenge-solution/01_original-solution/main.go
function main (line 7) | func main() {
function gen (line 18) | func gen() <-chan int {
function factorial (line 31) | func factorial(in <-chan int) <-chan int {
function fact (line 42) | func fact(n int) int {
FILE: 22_go-routines/12_channels_pipeline/04_challenge-solution/02_another-solution/main.go
constant numFactorials (line 9) | numFactorials = 100
constant rdLimit (line 10) | rdLimit = 20
function main (line 12) | func main() {
function factorial (line 20) | func factorial(wmain *sync.WaitGroup) {
FILE: 22_go-routines/13_channels_fan-out_fan-in/01_boring/main.go
function main (line 9) | func main() {
function boring (line 17) | func boring(msg string) <-chan string {
function fanIn (line 29) | func fanIn(input1, input2 <-chan string) <-chan string {
FILE: 22_go-routines/13_channels_fan-out_fan-in/02_sq-output/main.go
function main (line 8) | func main() {
function gen (line 23) | func gen(nums ...int) chan int {
function sq (line 36) | func sq(in chan int) chan int {
function merge (line 47) | func merge(cs ...chan int) chan int {
FILE: 22_go-routines/13_channels_fan-out_fan-in/03_sq-output_variation/main.go
function main (line 8) | func main() {
function gen (line 21) | func gen(nums ...int) <-chan int {
function sq (line 32) | func sq(in <-chan int) <-chan int {
function merge (line 43) | func merge(cs ...<-chan int) <-chan int {
FILE: 22_go-routines/13_channels_fan-out_fan-in/04_challenge-description/main.go
function main (line 11) | func main() {
function publisher (line 24) | func publisher(out chan string) {
function workerProcess (line 36) | func workerProcess(in <-chan string) {
FILE: 22_go-routines/13_channels_fan-out_fan-in/05_challenge-solution/main.go
function main (line 12) | func main() {
function publisher (line 25) | func publisher(out chan string) {
function workerProcess (line 41) | func workerProcess(in <-chan string) {
FILE: 22_go-routines/13_channels_fan-out_fan-in/06_challenge-description/main.go
function main (line 7) | func main() {
function gen (line 18) | func gen() <-chan int {
function factorial (line 31) | func factorial(in <-chan int) <-chan int {
function fact (line 42) | func fact(n int) int {
FILE: 22_go-routines/13_channels_fan-out_fan-in/07_challenge-solution/main.go
function main (line 8) | func main() {
function gen (line 37) | func gen() <-chan int {
function factorial (line 50) | func factorial(in <-chan int) <-chan int {
function fact (line 61) | func fact(n int) int {
function merge (line 69) | func merge(cs ...<-chan int) <-chan int {
FILE: 22_go-routines/13_channels_fan-out_fan-in/08_challenge-description/main.go
function main (line 8) | func main() {
function gen (line 26) | func gen() <-chan int {
function fanOut (line 39) | func fanOut(in <-chan int, n int) []<-chan int {
function factorial (line 47) | func factorial(in <-chan int) <-chan int {
function fact (line 58) | func fact(n int) int {
function merge (line 66) | func merge(cs ...<-chan int) <-chan int {
FILE: 22_go-routines/13_channels_fan-out_fan-in/09_challenge-solution/01_troubleshooting-step/main.go
function main (line 8) | func main() {
function gen (line 34) | func gen() <-chan int {
function fanOut (line 47) | func fanOut(in <-chan int, n int) []<-chan int {
function factorial (line 55) | func factorial(in <-chan int) <-chan int {
function fact (line 66) | func fact(n int) int {
function merge (line 74) | func merge(cs ...<-chan int) <-chan int {
FILE: 22_go-routines/13_channels_fan-out_fan-in/09_challenge-solution/02_solution/main.go
function main (line 8) | func main() {
function gen (line 26) | func gen() <-chan int {
function fanOut (line 39) | func fanOut(in <-chan int, n int) []<-chan int {
function factorial (line 47) | func factorial(in <-chan int) <-chan int {
function fact (line 58) | func fact(n int) int {
function merge (line 66) | func merge(cs ...<-chan int) <-chan int {
FILE: 22_go-routines/13_channels_fan-out_fan-in/10_van-sickle_fan-out_fan-in/main.go
function main (line 7) | func main() {
function gen (line 30) | func gen() <-chan int {
function fanOut (line 43) | func fanOut(in <-chan int, n int, out chan<- int) {
function factorial (line 49) | func factorial(in <-chan int, out chan<- int) {
function fact (line 58) | func fact(n int) int {
FILE: 22_go-routines/14_incrementor-challenge/01_description/main.go
function main (line 12) | func main() {
function incrementor (line 20) | func incrementor(s string) {
FILE: 22_go-routines/14_incrementor-challenge/02_solution/main.go
function main (line 8) | func main() {
function incrementor (line 21) | func incrementor(n int) chan string {
FILE: 22_go-routines/15_for-fun/01/main.go
function main (line 7) | func main() {
FILE: 23_error-handling/01_golint/01_before/main.go
function main (line 5) | func main() {
function evalInt (line 11) | func evalInt(n int) string {
FILE: 23_error-handling/01_golint/02_after/main.go
function main (line 5) | func main() {
function evalInt (line 11) | func evalInt(n int) string {
FILE: 23_error-handling/02_err-not-nil/01_fmt-println/main.go
function main (line 8) | func main() {
FILE: 23_error-handling/02_err-not-nil/02_log-println/main.go
function main (line 8) | func main() {
FILE: 23_error-handling/02_err-not-nil/03_log-set-output/main.go
function init (line 9) | func init() {
function main (line 17) | func main() {
FILE: 23_error-handling/02_err-not-nil/04_log-fatalln/main.go
function main (line 8) | func main() {
FILE: 23_error-handling/02_err-not-nil/05_panic/main.go
function main (line 7) | func main() {
FILE: 23_error-handling/03_custom-errors/01_errors-new/main.go
function main (line 8) | func main() {
function Sqrt (line 15) | func Sqrt(f float64) (float64, error) {
FILE: 23_error-handling/03_custom-errors/02_errors-new_var/main.go
function main (line 11) | func main() {
function Sqrt (line 19) | func Sqrt(f float64) (float64, error) {
FILE: 23_error-handling/03_custom-errors/03_fmt-errorf/main.go
function main (line 8) | func main() {
function Sqrt (line 15) | func Sqrt(f float64) (float64, error) {
FILE: 23_error-handling/03_custom-errors/04_fmt-errorf_var/main.go
function main (line 8) | func main() {
function Sqrt (line 15) | func Sqrt(f float64) (float64, error) {
FILE: 23_error-handling/03_custom-errors/05_custom-type/main.go
type NorgateMathError (line 8) | type NorgateMathError struct
method Error (line 13) | func (n *NorgateMathError) Error() string {
function main (line 17) | func main() {
function Sqrt (line 24) | func Sqrt(f float64) (float64, error) {
FILE: 24_testing/math.go
function Adder (line 3) | func Adder(xs ...int) int {
FILE: 24_testing/math_test.go
function TestAdder (line 9) | func TestAdder(t *testing.T) {
function BenchmarkAdder (line 16) | func BenchmarkAdder(b *testing.B) {
function ExampleAdder (line 22) | func ExampleAdder() {
function ExampleAdder_multiple (line 28) | func ExampleAdder_multiple() {
function TestAdderBlackbox (line 34) | func TestAdderBlackbox(t *testing.T) {
function a (line 41) | func a(x, y int) bool {
FILE: 25_code-walk/main.go
constant win (line 13) | win = 100
constant gamesPerSeries (line 14) | gamesPerSeries = 10
type score (line 17) | type score struct
type action (line 21) | type action
function roll (line 23) | func roll(s score) (score, bool) {
function stay (line 31) | func stay(s score) (score, bool) {
type strategy (line 35) | type strategy
function stayAtK (line 37) | func stayAtK(k int) strategy {
function play (line 46) | func play(strategy0, strategy1 strategy) int {
function roundRobin (line 61) | func roundRobin(strategies []strategy) ([]int, int) {
function ratioString (line 79) | func ratioString(vals ...int) string {
function main (line 95) | func main() {
FILE: 25_code-walk/with-comments/main.go
constant win (line 13) | win = 100
constant gamesPerSeries (line 14) | gamesPerSeries = 10
type score (line 19) | type score struct
type action (line 24) | type action
function roll (line 29) | func roll(s score) (score, bool) {
function stay (line 39) | func stay(s score) (score, bool) {
type strategy (line 44) | type strategy
function stayAtK (line 47) | func stayAtK(k int) strategy {
function play (line 57) | func play(strategy0, strategy1 strategy) int {
function roundRobin (line 73) | func roundRobin(strategies []strategy) ([]int, int) {
function ratioString (line 94) | func ratioString(vals ...int) string {
function main (line 110) | func main() {
FILE: 26_QUESTIONS-FROM-STUDENTS/01-package-scope/main.go
function main (line 5) | func main() {
FILE: 26_QUESTIONS-FROM-STUDENTS/02-goroutines-printing/main.go
function main (line 5) | func main() {
FILE: 26_QUESTIONS-FROM-STUDENTS/03-range-chan/main.go
function main (line 8) | func main() {
function gen (line 37) | func gen() <-chan int {
function factorial (line 50) | func factorial(in <-chan int) <-chan int {
function fact (line 61) | func fact(n int) int {
function merge (line 69) | func merge(cs ...<-chan int) <-chan int {
FILE: 26_QUESTIONS-FROM-STUDENTS/04_goroutines_closing-chan/01_broken-code/main.go
function main (line 10) | func main() {
function incrementor (line 18) | func incrementor(s string) <-chan string {
function fanIn (line 30) | func fanIn(input1, input2 <-chan string) <-chan string {
FILE: 26_QUESTIONS-FROM-STUDENTS/04_goroutines_closing-chan/02_fixed-code/main.go
function main (line 7) | func main() {
function incrementor (line 43) | func incrementor(s string) <-chan string {
function fanIn (line 71) | func fanIn(input1, input2 <-chan string) <-chan string {
FILE: 26_QUESTIONS-FROM-STUDENTS/05_concurrency-channels/main.go
function main (line 5) | func main() {
FILE: 26_QUESTIONS-FROM-STUDENTS/06_performance-ramifications/01_called/main.go
function main (line 8) | func main() {
function gen (line 21) | func gen() <-chan int {
function factorial (line 34) | func factorial(in <-chan int) <-chan int {
function fact (line 45) | func fact(n int) int {
FILE: 26_QUESTIONS-FROM-STUDENTS/06_performance-ramifications/02_not-called/main.go
function main (line 8) | func main() {
function gen (line 21) | func gen() <-chan int {
function factorial (line 34) | func factorial(in <-chan int) <-chan int {
FILE: 27_code-in-process/26_playing-with-type/00_types/01_division/01_int-int/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/01_division/02_int-float/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/01_division/03_var_int-float/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/01_division/04_var_int-float_invalid-code/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/01_escape-sequences/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/02_sequence-of-bytes/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/03_immutable/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/04_len/01_len-english/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/04_len/02_len-chinese/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/04_len/03_binary/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/05_index-access/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/06_slicing/01/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/06_slicing/02/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/06_slicing/03_invalid_negative-index/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/02_strings/07_concatenation/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/03_strconv/01_itoa/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/03_strconv/02_fmt-sprint/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/03_strconv/03_atoi/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/06_math-pkg/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/07_typeOf/01_better-code/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/26_playing-with-type/00_types/07_typeOf/02_worse-code/main.go
function main (line 12) | func main() {
FILE: 27_code-in-process/26_playing-with-type/01_struct/main.go
type person (line 5) | type person struct
function main (line 10) | func main() {
FILE: 27_code-in-process/26_playing-with-type/02_string/main.go
type mySentence (line 5) | type mySentence
function main (line 7) | func main() {
FILE: 27_code-in-process/26_playing-with-type/03_string-conversion/main.go
type mySentence (line 5) | type mySentence
function main (line 7) | func main() {
FILE: 27_code-in-process/26_playing-with-type/04_string_assertion_invalid-code/main.go
type mySentence (line 5) | type mySentence
function main (line 7) | func main() {
FILE: 27_code-in-process/26_playing-with-type/05_var-for-zero-val-initalization/main.go
type person (line 5) | type person struct
function main (line 10) | func main() {
FILE: 27_code-in-process/26_playing-with-type/06_shorthand-notation_nonzero-initalization/main.go
type person (line 5) | type person struct
function main (line 10) | func main() {
FILE: 27_code-in-process/26_playing-with-type/xx05_slice-strings/main.go
type mySentences (line 5) | type mySentences
function main (line 7) | func main() {
FILE: 27_code-in-process/26_playing-with-type/xx06_slice-strings_conversion/main.go
type mySentences (line 5) | type mySentences
function main (line 7) | func main() {
FILE: 27_code-in-process/26_playing-with-type/xx07_int/main.go
type myType (line 5) | type myType
function main (line 7) | func main() {
FILE: 27_code-in-process/26_playing-with-type/xx08_slice-ints/main.go
type myType (line 5) | type myType
function main (line 7) | func main() {
FILE: 27_code-in-process/27_package-os/00_args/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/27_package-os/01_Read/01/main.go
function main (line 7) | func main() {
FILE: 27_code-in-process/27_package-os/02_Write/01/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/27_package-os/02_Write/02/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/27_package-os/02_Write/03_absolute-path/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/27_package-os/03_mkdir/01/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/27_package-os/03_mkdir/02/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/27_package-os/04_FileMode/01/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/27_package-os/04_FileMode/02/main.go
constant ModeDir (line 6) | ModeDir = 1 << (32 - 1 - iota)
constant ModeAppend (line 7) | ModeAppend
constant ModeExclusive (line 8) | ModeExclusive
constant ModeTemporary (line 9) | ModeTemporary
constant ModeSymlink (line 10) | ModeSymlink
constant ModeDevice (line 11) | ModeDevice
constant ModeNamedPipe (line 12) | ModeNamedPipe
constant ModeSocket (line 13) | ModeSocket
constant ModeSetuid (line 14) | ModeSetuid
constant ModeSetgid (line 15) | ModeSetgid
constant ModeCharDevice (line 16) | ModeCharDevice
constant ModeSticky (line 17) | ModeSticky
function main (line 20) | func main() {
FILE: 27_code-in-process/27_package-os/05_file-open/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/27_package-os/06_file-create/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/27_package-os/07_Stdout_Stdin/01/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/27_package-os/07_Stdout_Stdin/02/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/28_package-strings/01_strings/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/28_package-strings/02_NewReader/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/29_package-bufio/01_NewReader/main.go
function cp (line 11) | func cp(srcName, dstName string) error {
function main (line 35) | func main() {
FILE: 27_code-in-process/29_package-bufio/02_NewScanner/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/29_package-bufio/03_scan-lines/01/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/29_package-bufio/03_scan-lines/02/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/29_package-bufio/04_scan-words/01/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/29_package-bufio/04_scan-words/02/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/29_package-bufio/04_scan-words/03/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/30_package-io/01_copy/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/30_package-io/02_copy/main.go
function cp (line 10) | func cp(srcName, dstName string) error {
function main (line 32) | func main() {
FILE: 27_code-in-process/30_package-io/03_copy/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/30_package-io/04_TeeReader/01/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/30_package-io/04_TeeReader/02/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/30_package-io/05_ReadFull/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/30_package-io/06_LimitReader/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/30_package-io/07_WriteString/01_one-way/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/30_package-io/07_WriteString/02_another-way/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/31_package-ioutil/00_ReadAll/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/31_package-ioutil/01_ReadAll/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/31_package-ioutil/02_WriteFile/main.go
function main (line 7) | func main() {
FILE: 27_code-in-process/31_package-ioutil/03_ReadAll_WriteFile/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/32_package-encoding-csv/01_NewReader/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/32_package-encoding-csv/02_column-headings/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/32_package-encoding-csv/03_panics/main.go
type state (line 10) | type state struct
function parseState (line 17) | func parseState(columns map[string]int, record []string) (*state, error) {
function main (line 21) | func main() {
FILE: 27_code-in-process/32_package-encoding-csv/04_parse-state/main.go
type state (line 11) | type state struct
function parseState (line 18) | func parseState(columns map[string]int, record []string) (*state, error) {
function main (line 34) | func main() {
FILE: 27_code-in-process/32_package-encoding-csv/05_state-lookup/main.go
type state (line 12) | type state struct
function parseState (line 19) | func parseState(columns map[string]int, record []string) (*state, error) {
function main (line 35) | func main() {
FILE: 27_code-in-process/32_package-encoding-csv/06_write-to-html/main.go
type state (line 12) | type state struct
function parseState (line 19) | func parseState(columns map[string]int, record []string) (*state, error) {
function main (line 35) | func main() {
FILE: 27_code-in-process/32_package-encoding-csv/07_NewReader/main.go
type record (line 10) | type record struct
function makeRecord (line 15) | func makeRecord(row []string) record {
function main (line 23) | func main() {
FILE: 27_code-in-process/33_package-path-filepath/01_Walk/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/33_package-path-filepath/02_Walk/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/33_package-path-filepath/03_Walk/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/33_package-path-filepath/04_Walk/main.go
function md5file (line 11) | func md5file(fileName string) []byte {
function main (line 23) | func main() {
FILE: 27_code-in-process/34_package-time/01_now/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/34_package-time/02_time-parse/01/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/34_package-time/02_time-parse/02/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/34_package-time/03_format/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/34_package-time/04_date-diff/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/35_hash/01_FNV/01/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/35_hash/01_FNV/02/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/35_hash/02_MD5/01/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/35_hash/02_MD5/02/main.go
function main (line 12) | func main() {
FILE: 27_code-in-process/36_package-filepath/01_walk/main.go
function walk (line 9) | func walk() {
function main (line 22) | func main() {
FILE: 27_code-in-process/37_review-exercises/01_gravatar/main.go
function getGravatarHash (line 12) | func getGravatarHash(email string) string {
function main (line 22) | func main() {
FILE: 27_code-in-process/37_review-exercises/02_word-count/main.go
function wordCount (line 8) | func wordCount(str string) map[string]int {
function main (line 18) | func main() {
FILE: 27_code-in-process/37_review-exercises/03_centered_average/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/37_review-exercises/04_swap-two_pointers/main.go
function swap (line 5) | func swap(x, y *int) {
function main (line 9) | func main() {
FILE: 27_code-in-process/37_review-exercises/05_clumps/main.go
function countClumps (line 5) | func countClumps(xs []int) int {
function main (line 21) | func main() {
FILE: 27_code-in-process/37_review-exercises/06_cat/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/37_review-exercises/07_copy/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/37_review-exercises/08_cp/01/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/37_review-exercises/08_cp/02/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/37_review-exercises/08_cp/03/main.go
function cp (line 10) | func cp(srcName, dstName string) error {
function main (line 37) | func main() {
FILE: 27_code-in-process/37_review-exercises/08_cp/04_io-copy/main.go
function cp (line 10) | func cp(srcName, dstName string) error {
function main (line 32) | func main() {
FILE: 27_code-in-process/37_review-exercises/08_cp/05_os-write_slice-bytes/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/37_review-exercises/08_cp/06_io-copy_string-NewReader/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/37_review-exercises/08_cp/07_io-copy_bufio-NewReader/main.go
function cp (line 11) | func cp(srcName, dstName string) error {
function main (line 35) | func main() {
FILE: 27_code-in-process/37_review-exercises/08_cp/08_bufio_scanner/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/37_review-exercises/09_sentence-case/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/37_review-exercises/10_every-word/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/37_review-exercises/11_every-other-word/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/37_review-exercises/12_count-words/main.go
function wordCount (line 12) | func wordCount(rdr io.Reader) map[string]int {
function main (line 26) | func main() {
FILE: 27_code-in-process/37_review-exercises/13_longest-word/main.go
function longestWord (line 11) | func longestWord(rdr io.Reader) string {
function main (line 24) | func main() {
FILE: 27_code-in-process/37_review-exercises/14_cat-files/01/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/37_review-exercises/14_cat-files/02/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/37_review-exercises/15_csv_state-info/step01_read-and-output/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/37_review-exercises/15_csv_state-info/step02_column-headings/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/37_review-exercises/15_csv_state-info/step03_panics/main.go
type state (line 10) | type state struct
function parseState (line 17) | func parseState(columns map[string]int, record []string) (*state, error) {
function main (line 21) | func main() {
FILE: 27_code-in-process/37_review-exercises/15_csv_state-info/step04_parse-state/main.go
type state (line 11) | type state struct
function parseState (line 18) | func parseState(columns map[string]int, record []string) (*state, error) {
function main (line 34) | func main() {
FILE: 27_code-in-process/37_review-exercises/15_csv_state-info/step05_state-lookup/main.go
type state (line 12) | type state struct
function parseState (line 19) | func parseState(columns map[string]int, record []string) (*state, error) {
function main (line 35) | func main() {
FILE: 27_code-in-process/37_review-exercises/15_csv_state-info/step06_write-to-html/main.go
type state (line 12) | type state struct
function parseState (line 19) | func parseState(columns map[string]int, record []string) (*state, error) {
function main (line 35) | func main() {
FILE: 27_code-in-process/37_review-exercises/16_csv_stock-prices/step01_stdout/main.go
type record (line 10) | type record struct
function makeRecord (line 15) | func makeRecord(row []string) record {
function main (line 23) | func main() {
FILE: 27_code-in-process/37_review-exercises/16_csv_stock-prices/step02_html/main.go
type record (line 10) | type record struct
function makeRecord (line 15) | func makeRecord(row []string) record {
function main (line 23) | func main() {
FILE: 27_code-in-process/37_review-exercises/16_csv_stock-prices/step03_charting/main.go
type record (line 11) | type record struct
function makeRecord (line 16) | func makeRecord(row []string) record {
function main (line 24) | func main() {
FILE: 27_code-in-process/37_review-exercises/17_MD5-checksum/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/37_review-exercises/18_Walk-dir/main.go
function md5file (line 11) | func md5file(fileName string) []byte {
function main (line 23) | func main() {
FILE: 27_code-in-process/38_JSON/01/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/38_JSON/02/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/38_JSON/03/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/38_JSON/04/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/38_JSON/05/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/38_JSON/06/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/38_JSON/07/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/38_JSON/08/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/38_JSON/09/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/38_JSON/10/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/38_JSON/11/main.go
type Anything (line 10) | type Anything interface
function main (line 12) | func main() {
FILE: 27_code-in-process/38_JSON/12/main.go
type Anything (line 9) | type Anything interface
function main (line 11) | func main() {
FILE: 27_code-in-process/38_JSON/13/main.go
type StockData (line 9) | type StockData struct
function main (line 13) | func main() {
FILE: 27_code-in-process/38_JSON/14/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/38_JSON/15/main.go
type StockData (line 11) | type StockData struct
function toFloat (line 21) | func toFloat(str string) float64 {
function main (line 26) | func main() {
FILE: 27_code-in-process/38_JSON/15_exercise_csv-to-JSON/01/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/38_JSON/15_exercise_csv-to-JSON/02/main.go
type StockData (line 11) | type StockData struct
function toFloat (line 21) | func toFloat(str string) float64 {
function main (line 26) | func main() {
FILE: 27_code-in-process/38_JSON/16/main.go
type Article (line 10) | type Article struct
function main (line 15) | func main() {
FILE: 27_code-in-process/38_JSON/17/main.go
type Record (line 11) | type Record struct
function main (line 17) | func main() {
FILE: 27_code-in-process/39_packages/hello/bye.go
function ByeBye (line 5) | func ByeBye() {
function looper (line 9) | func looper(str string) string {
FILE: 27_code-in-process/39_packages/hello/hello.go
function Hello (line 5) | func Hello() {
FILE: 27_code-in-process/39_packages/main/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/40_testing/01/example/sum.go
function Sum (line 7) | func Sum(nums ...int) int {
FILE: 27_code-in-process/40_testing/01/example/sum_test.go
function TestSum (line 5) | func TestSum(t *testing.T) {
FILE: 27_code-in-process/40_testing/01/main.go
function main (line 7) | func main() {
FILE: 27_code-in-process/40_testing/02/example/sum.go
function Sum (line 7) | func Sum(nums ...int) int {
FILE: 27_code-in-process/40_testing/02/example/sum_test.go
type testpair (line 5) | type testpair struct
function TestSum (line 16) | func TestSum(t *testing.T) {
FILE: 27_code-in-process/40_testing/02/main.go
function main (line 7) | func main() {
FILE: 27_code-in-process/41_TCP/02_listen/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/41_TCP/03_dial/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/41_TCP/04_echo-server/v01/main.go
function main (line 5) | func main() {
FILE: 27_code-in-process/41_TCP/04_echo-server/v02/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/41_TCP/04_echo-server/v03/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/41_TCP/04_echo-server/v04/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/41_TCP/05_redis-clone/i01/main.go
function handle (line 10) | func handle(conn net.Conn) {
function main (line 20) | func main() {
FILE: 27_code-in-process/41_TCP/05_redis-clone/i02/main.go
function handle (line 11) | func handle(conn net.Conn) {
function main (line 33) | func main() {
FILE: 27_code-in-process/41_TCP/05_redis-clone/i03/main.go
function handle (line 14) | func handle(conn net.Conn) {
function main (line 46) | func main() {
FILE: 27_code-in-process/41_TCP/05_redis-clone/i04/main.go
function handle (line 14) | func handle(conn net.Conn) {
function main (line 56) | func main() {
FILE: 27_code-in-process/41_TCP/05_redis-clone/i05_code-issue/main.go
function handle (line 14) | func handle(conn net.Conn) {
function main (line 48) | func main() {
FILE: 27_code-in-process/41_TCP/05_redis-clone/i06/main.go
type Command (line 12) | type Command struct
function redisServer (line 17) | func redisServer(commands chan Command) {
function handle (line 56) | func handle(commands chan Command, conn net.Conn) {
function main (line 75) | func main() {
FILE: 27_code-in-process/41_TCP/06_rot13-server/v01-todd/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/41_TCP/06_rot13-server/v02-caleb/main.go
type Rot13Reader (line 9) | type Rot13Reader struct
method Read (line 13) | func (rot13 *Rot13Reader) Read(p []byte) (int, error) {
function rot13 (line 33) | func rot13(rdr io.Reader) io.Reader {
function handleConn (line 37) | func handleConn(conn net.Conn) {
function main (line 42) | func main() {
FILE: 27_code-in-process/41_TCP/06_rot13-server/v03-daniel/main.go
function handleConn (line 10) | func handleConn(conn net.Conn) {
function main (line 36) | func main() {
FILE: 27_code-in-process/41_TCP/07_chat-server/main.go
type User (line 11) | type User struct
type Message (line 16) | type Message struct
type ChatServer (line 21) | type ChatServer struct
method Run (line 28) | func (cs *ChatServer) Run() {
function handleConn (line 58) | func handleConn(chatServer *ChatServer, conn net.Conn) {
function main (line 93) | func main() {
FILE: 27_code-in-process/42_HTTP/01_header/main.go
function handleConn (line 10) | func handleConn(conn net.Conn) {
function main (line 18) | func main() {
FILE: 27_code-in-process/42_HTTP/02_http-server/i01/main.go
function handleConn (line 11) | func handleConn(conn net.Conn) {
function main (line 30) | func main() {
FILE: 27_code-in-process/42_HTTP/02_http-server/i02/main.go
function handleConn (line 11) | func handleConn(conn net.Conn) {
function main (line 34) | func main() {
FILE: 27_code-in-process/42_HTTP/02_http-server/i03/main.go
function handleConn (line 12) | func handleConn(conn net.Conn) {
function main (line 43) | func main() {
FILE: 27_code-in-process/42_HTTP/02_http-server/i04_POST/main.go
function handleConn (line 12) | func handleConn(conn net.Conn) {
function main (line 57) | func main() {
FILE: 27_code-in-process/42_HTTP/02_http-server/i05_not-writing_error-in-code/main.go
function handleConn (line 13) | func handleConn(conn net.Conn) {
function main (line 74) | func main() {
FILE: 27_code-in-process/42_HTTP/02_http-server/i06_PLAIN-TEXT/main.go
function handleConn (line 12) | func handleConn(conn net.Conn) {
function main (line 55) | func main() {
FILE: 27_code-in-process/42_HTTP/02_http-server/i07_Location/main.go
function handleConn (line 12) | func handleConn(conn net.Conn) {
function main (line 56) | func main() {
FILE: 27_code-in-process/42_HTTP/03_http-server_return-URL/main.go
function handleConn (line 12) | func handleConn(conn net.Conn) {
function main (line 45) | func main() {
FILE: 27_code-in-process/43_HTTP-server/01/i01/main.go
type MyHandler (line 7) | type MyHandler
method ServeHTTP (line 9) | func (h MyHandler) ServeHTTP(res http.ResponseWriter, req *http.Reques...
function main (line 13) | func main() {
FILE: 27_code-in-process/43_HTTP-server/01/i02/main.go
type MyHandler (line 8) | type MyHandler
method ServeHTTP (line 10) | func (h MyHandler) ServeHTTP(res http.ResponseWriter, req *http.Reques...
function main (line 14) | func main() {
FILE: 27_code-in-process/43_HTTP-server/02_requestURI/01/main.go
type myHandler (line 8) | type myHandler
method ServeHTTP (line 10) | func (h myHandler) ServeHTTP(resp http.ResponseWriter, req *http.Reque...
function main (line 14) | func main() {
FILE: 27_code-in-process/43_HTTP-server/02_requestURI/02/main.go
type myHandler (line 8) | type myHandler
method ServeHTTP (line 10) | func (h myHandler) ServeHTTP(resp http.ResponseWriter, req *http.Reque...
function main (line 14) | func main() {
FILE: 27_code-in-process/43_HTTP-server/03_restful/01/main.go
type myHandler (line 8) | type myHandler
method ServeHTTP (line 10) | func (h myHandler) ServeHTTP(res http.ResponseWriter, req *http.Reques...
function main (line 19) | func main() {
FILE: 27_code-in-process/43_HTTP-server/03_restful/02/main.go
type myHandler (line 8) | type myHandler
method ServeHTTP (line 10) | func (h myHandler) ServeHTTP(res http.ResponseWriter, req *http.Reques...
function main (line 20) | func main() {
FILE: 27_code-in-process/43_HTTP-server/03_restful/03/main.go
type myHandler (line 8) | type myHandler
method ServeHTTP (line 10) | func (h myHandler) ServeHTTP(res http.ResponseWriter, req *http.Reques...
function main (line 20) | func main() {
FILE: 27_code-in-process/44_MUX_routing/01/main.go
type DogHandler (line 8) | type DogHandler
method ServeHTTP (line 10) | func (h DogHandler) ServeHTTP(res http.ResponseWriter, req *http.Reque...
type CatHandler (line 14) | type CatHandler
method ServeHTTP (line 16) | func (h CatHandler) ServeHTTP(res http.ResponseWriter, req *http.Reque...
function main (line 20) | func main() {
FILE: 27_code-in-process/44_MUX_routing/02/main.go
type DogHandler (line 8) | type DogHandler
method ServeHTTP (line 10) | func (h DogHandler) ServeHTTP(res http.ResponseWriter, req *http.Reque...
type CatHandler (line 14) | type CatHandler
method ServeHTTP (line 16) | func (h CatHandler) ServeHTTP(res http.ResponseWriter, req *http.Reque...
function main (line 20) | func main() {
FILE: 27_code-in-process/44_MUX_routing/03/main.go
type DogHandler (line 8) | type DogHandler
method ServeHTTP (line 10) | func (h DogHandler) ServeHTTP(res http.ResponseWriter, req *http.Reque...
type CatHandler (line 14) | type CatHandler
method ServeHTTP (line 16) | func (h CatHandler) ServeHTTP(res http.ResponseWriter, req *http.Reque...
function main (line 20) | func main() {
FILE: 27_code-in-process/44_MUX_routing/04/main.go
type DogHandler (line 8) | type DogHandler
method ServeHTTP (line 10) | func (h DogHandler) ServeHTTP(res http.ResponseWriter, req *http.Reque...
type CatHandler (line 15) | type CatHandler
method ServeHTTP (line 17) | func (h CatHandler) ServeHTTP(res http.ResponseWriter, req *http.Reque...
function main (line 22) | func main() {
FILE: 27_code-in-process/44_MUX_routing/05/main.go
type DogHandler (line 9) | type DogHandler
method ServeHTTP (line 11) | func (h DogHandler) ServeHTTP(res http.ResponseWriter, req *http.Reque...
type CatHandler (line 24) | type CatHandler
method ServeHTTP (line 26) | func (h CatHandler) ServeHTTP(res http.ResponseWriter, req *http.Reque...
function main (line 39) | func main() {
FILE: 27_code-in-process/44_MUX_routing/06_HandleFunc/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/44_MUX_routing/07_HandleFunc/main.go
function upTown (line 8) | func upTown(res http.ResponseWriter, req *http.Request) {
function youUp (line 12) | func youUp(res http.ResponseWriter, req *http.Request) {
function main (line 16) | func main() {
FILE: 27_code-in-process/44_MUX_routing/08_HandleFunc/main.go
function upTown (line 8) | func upTown(res http.ResponseWriter, req *http.Request) {
function youUp (line 12) | func youUp(res http.ResponseWriter, req *http.Request) {
function main (line 16) | func main() {
FILE: 27_code-in-process/45_serving-files/01/main.go
function upTown (line 9) | func upTown(res http.ResponseWriter, req *http.Request) {
function main (line 24) | func main() {
FILE: 27_code-in-process/45_serving-files/02/main.go
function upTown (line 9) | func upTown(res http.ResponseWriter, req *http.Request) {
function main (line 23) | func main() {
FILE: 27_code-in-process/45_serving-files/03/main.go
function upTown (line 10) | func upTown(res http.ResponseWriter, req *http.Request) {
function main (line 24) | func main() {
FILE: 27_code-in-process/45_serving-files/04_io-Copy/main.go
function upTown (line 10) | func upTown(res http.ResponseWriter, req *http.Request) {
function dogPic (line 24) | func dogPic(res http.ResponseWriter, req *http.Request) {
function main (line 35) | func main() {
FILE: 27_code-in-process/45_serving-files/05_ServeContent/main.go
function upTown (line 10) | func upTown(res http.ResponseWriter, req *http.Request) {
function dogPic (line 24) | func dogPic(res http.ResponseWriter, req *http.Request) {
function main (line 41) | func main() {
FILE: 27_code-in-process/45_serving-files/06_ServeFile/main.go
function upTown (line 9) | func upTown(res http.ResponseWriter, req *http.Request) {
function dogPic (line 23) | func dogPic(res http.ResponseWriter, req *http.Request) {
function main (line 27) | func main() {
FILE: 27_code-in-process/45_serving-files/07_FileServer/main.go
function upTown (line 9) | func upTown(res http.ResponseWriter, req *http.Request) {
function main (line 23) | func main() {
FILE: 27_code-in-process/45_serving-files/08_FileServer/main.go
function upTown (line 9) | func upTown(res http.ResponseWriter, req *http.Request) {
function main (line 23) | func main() {
FILE: 27_code-in-process/45_serving-files/09_FileServer/main.go
function upTown (line 9) | func upTown(res http.ResponseWriter, req *http.Request) {
function main (line 23) | func main() {
FILE: 27_code-in-process/45_serving-files/10_static-file-server/main.go
function main (line 7) | func main() {
FILE: 27_code-in-process/45_serving-files/11_static-file-server/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/46_errata/01_set-header/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/46_errata/02_URL/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/46_errata/03_URL/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/46_errata/04_URL/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/46_errata/05_ServeFile/main.go
function upTown (line 9) | func upTown(res http.ResponseWriter, req *http.Request) {
function dogPic (line 23) | func dogPic(res http.ResponseWriter, req *http.Request) {
function main (line 27) | func main() {
FILE: 27_code-in-process/47_templates/01_text-templates/01/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/47_templates/01_text-templates/02/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/47_templates/01_text-templates/03/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/47_templates/01_text-templates/04/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/47_templates/01_text-templates/05/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/47_templates/01_text-templates/06/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/47_templates/01_text-templates/07/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/47_templates/01_text-templates/08/main.go
type Page (line 9) | type Page struct
function main (line 14) | func main() {
FILE: 27_code-in-process/47_templates/01_text-templates/09_function/main.go
type Page (line 9) | type Page struct
function main (line 14) | func main() {
FILE: 27_code-in-process/47_templates/01_text-templates/10_function/main.go
type Page (line 10) | type Page struct
function main (line 15) | func main() {
FILE: 27_code-in-process/47_templates/01_text-templates/11/main.go
type Page (line 10) | type Page struct
function main (line 15) | func main() {
FILE: 27_code-in-process/47_templates/02_html-templates/01/main.go
type Page (line 10) | type Page struct
function main (line 15) | func main() {
FILE: 27_code-in-process/47_templates/02_html-templates/02/main.go
type Page (line 10) | type Page struct
function main (line 15) | func main() {
FILE: 27_code-in-process/47_templates/02_html-templates/03/main.go
type Page (line 9) | type Page struct
function main (line 14) | func main() {
FILE: 27_code-in-process/47_templates/02_html-templates/04/main.go
type Page (line 10) | type Page struct
function main (line 15) | func main() {
FILE: 27_code-in-process/47_templates/02_html-templates/05/main.go
type Page (line 10) | type Page struct
function main (line 15) | func main() {
FILE: 27_code-in-process/47_templates/x03_exercises/01/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/47_templates/x03_exercises/02/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/47_templates/x03_exercises/03_template_csv-parse/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/47_templates/x03_exercises/03_template_csv-parse/parse/parse.go
type Record (line 10) | type Record struct
function Parse (line 15) | func Parse(filePath string) []Record {
FILE: 27_code-in-process/48_passing-data/01_URL-values/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/48_passing-data/02_form-values/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/48_passing-data/03_form-values/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/48_passing-data/04_form-values/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/48_passing-data/05_form-values/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/48_passing-data/06_form-values/01/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/48_passing-data/06_form-values/02/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/48_passing-data/07_form-data/main.go
type Person (line 11) | type Person struct
function main (line 16) | func main() {
FILE: 27_code-in-process/48_passing-data/08_form_file-upload/01/main.go
function main (line 12) | func main() {
FILE: 27_code-in-process/48_passing-data/08_form_file-upload/02/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/48_passing-data/08_form_file-upload/03/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/48_passing-data/08_form_file-upload/04/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/01_set-cookie/main.go
function main (line 7) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/02_get-cookie/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/03_sessions/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/04_sessions/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/05_sessions-HMAC/01/main.go
function getCode (line 11) | func getCode(data string) string {
function main (line 17) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/05_sessions-HMAC/02/main.go
function getCode (line 11) | func getCode(data string) string {
function main (line 18) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/06_sessions_GORILLA/main.go
function main (line 12) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/07_cookies_show-visits/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/08_log-in-out/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/09_HTTPS-TLS/main.go
function handler (line 8) | func handler(w http.ResponseWriter, req *http.Request) {
function main (line 13) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/10_HTTPS-TLS/main.go
function handler (line 8) | func handler(w http.ResponseWriter, req *http.Request) {
function main (line 13) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/11_HTTPS-TLS/main.go
function handler (line 8) | func handler(w http.ResponseWriter, req *http.Request) {
function redir (line 13) | func redir(w http.ResponseWriter, req *http.Request) {
function main (line 17) | func main() {
FILE: 27_code-in-process/49_cookies-sessions/12_GORILLA_photo-blog/main.go
function init (line 20) | func init() {
function main (line 24) | func main() {
function index (line 33) | func index(res http.ResponseWriter, req *http.Request) {
function logout (line 53) | func logout(res http.ResponseWriter, req *http.Request) {
function login (line 60) | func login(res http.ResponseWriter, req *http.Request) {
function uploadPhoto (line 72) | func uploadPhoto(src multipart.File, hdr *multipart.FileHeader, session ...
function getSha (line 84) | func getSha(src multipart.File) string {
function addPhoto (line 90) | func addPhoto(fName string, session *sessions.Session) {
function getPhotos (line 97) | func getPhotos(session *sessions.Session) []string {
FILE: 27_code-in-process/50_exif/main.go
function main (line 11) | func main() {
FILE: 27_code-in-process/51_appengine-introduction/01_hello-world/hello.go
function init (line 8) | func init() {
function handler (line 12) | func handler(w http.ResponseWriter, r *http.Request) {
FILE: 27_code-in-process/51_appengine-introduction/02_photo-blog_somewhat-crappy-code-FYI/photos.go
function init (line 19) | func init() {
function home (line 33) | func home(res http.ResponseWriter, req *http.Request) {
function admin (line 85) | func admin(res http.ResponseWriter, req *http.Request) {
function upload (line 100) | func upload(res http.ResponseWriter, req *http.Request) {
function logout (line 128) | func logout(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/51_appengine-introduction/03_google-maps-api/hello.go
constant GoogleAPIKey (line 11) | GoogleAPIKey = "AIzaSyDpMNCWNz2UENVGQOS6zMFvtLsXn0zMBf4"
function init (line 15) | func init() {
function handleIndex (line 24) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/51_appengine-introduction/04_SERVICE_users/main.go
function index (line 11) | func index(res http.ResponseWriter, req *http.Request) {
function admin (line 20) | func admin(res http.ResponseWriter, req *http.Request) {
function init (line 29) | func init() {
FILE: 27_code-in-process/51_appengine-introduction/05_GORILLA_photo-blog/main.go
function init (line 20) | func init() {
function index (line 30) | func index(res http.ResponseWriter, req *http.Request) {
function logout (line 51) | func logout(res http.ResponseWriter, req *http.Request) {
function login (line 59) | func login(res http.ResponseWriter, req *http.Request) {
function uploadPhoto (line 72) | func uploadPhoto(src multipart.File, hdr *multipart.FileHeader, session ...
function getSha (line 84) | func getSha(src multipart.File) string {
function addPhoto (line 90) | func addPhoto(fName string, session *sessions.Session) {
function getPhotos (line 97) | func getPhotos(session *sessions.Session) []string {
FILE: 27_code-in-process/52_memcache/01_get-nil/main.go
function init (line 12) | func init() {
function handleIndex (line 16) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/52_memcache/02_set_get/main.go
function init (line 12) | func init() {
function handleIndex (line 16) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/52_memcache/03_expiration/main.go
function init (line 12) | func init() {
function handleIndex (line 16) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/52_memcache/04_increment/main.go
function index (line 12) | func index(res http.ResponseWriter, req *http.Request) {
function init (line 30) | func init() {
FILE: 27_code-in-process/52_memcache/05_memcache-session/01i/main.go
function init (line 8) | func init() {
function handleIndex (line 12) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/52_memcache/05_memcache-session/02i/main.go
function init (line 9) | func init() {
function handleIndex (line 13) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/52_memcache/05_memcache-session/03i/main.go
function init (line 11) | func init() {
function handleIndex (line 15) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/52_memcache/05_memcache-session/04i/main.go
function init (line 12) | func init() {
function handleIndex (line 16) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/52_memcache/05_memcache-session/05i/main.go
function init (line 12) | func init() {
function handleIndex (line 16) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/52_memcache/05_memcache-session/06_photo-blog_UNFINISHED/main.go
type Data (line 18) | type Data struct
function init (line 26) | func init() {
function index (line 36) | func index(res http.ResponseWriter, req *http.Request) {
function createCookie (line 75) | func createCookie() *http.Cookie {
function logout (line 83) | func logout(res http.ResponseWriter, req *http.Request) {
function login (line 94) | func login(res http.ResponseWriter, req *http.Request) {
function setMemcache (line 104) | func setMemcache(res http.ResponseWriter, req *http.Request) {
function uploadPhoto (line 125) | func uploadPhoto(m map[string]string, src multipart.File, hdr *multipart...
function getSha (line 138) | func getSha(src multipart.File) string {
function addPhoto (line 144) | func addPhoto(m map[string]string, fName string) {
function getPhotos (line 153) | func getPhotos(m map[string]string) []string {
FILE: 27_code-in-process/53_datastore/00_appengine-documentation-example/01_with-modifications/main.go
type Entity (line 10) | type Entity struct
function init (line 14) | func init() {
function home (line 18) | func home(w http.ResponseWriter, r *http.Request) {
FILE: 27_code-in-process/53_datastore/00_appengine-documentation-example/02_as-in-documentation/main.go
type Entity (line 10) | type Entity struct
function init (line 14) | func init() {
function home (line 18) | func home(w http.ResponseWriter, r *http.Request) {
FILE: 27_code-in-process/53_datastore/00_appengine-documentation-example/03_no-favicon/main.go
type Entity (line 10) | type Entity struct
function init (line 14) | func init() {
function home (line 18) | func home(w http.ResponseWriter, r *http.Request) {
FILE: 27_code-in-process/53_datastore/00_appengine-documentation-example/04_no-favicon/main.go
type Entity (line 10) | type Entity struct
function init (line 14) | func init() {
function home (line 19) | func home(w http.ResponseWriter, r *http.Request) {
FILE: 27_code-in-process/53_datastore/01_partial-example_does-not-run/main.go
type Employee (line 13) | type Employee struct
function handle (line 20) | func handle(w http.ResponseWriter, r *http.Request) {
FILE: 27_code-in-process/53_datastore/02/01_put/words.go
function init (line 11) | func init() {
type Word (line 15) | type Word struct
function handleIndex (line 20) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/53_datastore/02/02/words.go
function init (line 11) | func init() {
type Word (line 15) | type Word struct
function handleIndex (line 20) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/53_datastore/02/03_get/words.go
function init (line 12) | func init() {
type Word (line 16) | type Word struct
function handleWords (line 21) | func handleWords(res http.ResponseWriter, req *http.Request) {
function listWords (line 36) | func listWords(res http.ResponseWriter, req *http.Request) {
function showWord (line 71) | func showWord(res http.ResponseWriter, req *http.Request, term string) {
function saveWord (line 92) | func saveWord(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/53_datastore/02/04_query-filter/words.go
function init (line 12) | func init() {
type Word (line 16) | type Word struct
function handleWords (line 21) | func handleWords(res http.ResponseWriter, req *http.Request) {
function listWords (line 36) | func listWords(res http.ResponseWriter, req *http.Request) {
function showWord (line 74) | func showWord(res http.ResponseWriter, req *http.Request, term string) {
function saveWord (line 95) | func saveWord(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/53_datastore/02/05_query-ancestor/words.go
function init (line 13) | func init() {
type Animal (line 18) | type Animal struct
type Ate (line 23) | type Ate struct
function handleAnimals (line 27) | func handleAnimals(res http.ResponseWriter, req *http.Request) {
function listAnimals (line 40) | func listAnimals(res http.ResponseWriter, req *http.Request) {
function showAnimal (line 75) | func showAnimal(res http.ResponseWriter, req *http.Request, term string) {
function saveAnimal (line 122) | func saveAnimal(res http.ResponseWriter, req *http.Request) {
function ateProcess (line 141) | func ateProcess(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/53_datastore/03_users_datastore_exercise/main.go
type Profile (line 14) | type Profile struct
function init (line 21) | func init() {
function showIndex (line 29) | func showIndex(res http.ResponseWriter, req *http.Request, params httpro...
function showProfile (line 33) | func showProfile(res http.ResponseWriter, req *http.Request, params http...
function updateProfile (line 54) | func updateProfile(res http.ResponseWriter, req *http.Request, params ht...
FILE: 27_code-in-process/53_datastore/04_julien-schmidt-router/01/main.go
function Index (line 10) | func Index(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
function Hello (line 14) | func Hello(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
function main (line 18) | func main() {
FILE: 27_code-in-process/53_datastore/04_julien-schmidt-router/02-with-appengine/main.go
function Index (line 9) | func Index(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
function Hello (line 13) | func Hello(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
function init (line 17) | func init() {
FILE: 27_code-in-process/54_AJAX/02_users_datastore_exercise_AJAX/main.go
type Profile (line 14) | type Profile struct
function init (line 21) | func init() {
function getAPIProfile (line 30) | func getAPIProfile(res http.ResponseWriter, req *http.Request, params ht...
function updateAPIProfile (line 42) | func updateAPIProfile(res http.ResponseWriter, req *http.Request, params...
function showIndex (line 55) | func showIndex(res http.ResponseWriter, req *http.Request, params httpro...
function showProfile (line 59) | func showProfile(res http.ResponseWriter, req *http.Request, params http...
FILE: 27_code-in-process/55_todo-list/01v_content-editable/main.go
type ToDo (line 14) | type ToDo struct
function init (line 20) | func init() {
function handleIndex (line 26) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleTodos (line 34) | func handleTodos(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/55_todo-list/02v_input/main.go
type ToDo (line 14) | type ToDo struct
function init (line 20) | func init() {
function handleIndex (line 26) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleTodos (line 34) | func handleTodos(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/56_twitter/02_ListenAndServe/main.go
function main (line 10) | func main() {
function home (line 18) | func home(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/56_twitter/03_error-handling/main.go
function main (line 11) | func main() {
function home (line 19) | func home(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/56_twitter/04_template_abstraction/main.go
function main (line 11) | func main() {
function home (line 19) | func home(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/56_twitter/05_document/main.go
function main (line 37) | func main() {
function home (line 49) | func home(res http.ResponseWriter, req *http.Request) {
function GodocExperiment (line 59) | func GodocExperiment() {
function godocUnexported (line 65) | func godocUnexported() {
FILE: 27_code-in-process/56_twitter/06_document/main.go
function main (line 11) | func main() {
function home (line 19) | func home(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/56_twitter/07_app-engine/main.go
function init (line 10) | func init() {
function home (line 19) | func home(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/56_twitter/08_julien-schmidt/main.go
function init (line 11) | func init() {
function Home (line 20) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
FILE: 27_code-in-process/56_twitter/09_login-form/main.go
function init (line 11) | func init() {
function Home (line 22) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 30) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 34) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/10_signup-form-validate/01v_form-validation/main.go
type User (line 15) | type User struct
function init (line 23) | func init() {
function Home (line 36) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 44) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 48) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function checkUserName (line 52) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 71) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/10_signup-form-validate/02v_datastore-put/main.go
type User (line 14) | type User struct
function init (line 22) | func init() {
function Home (line 35) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 43) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 47) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function checkUserName (line 51) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 70) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/11_HTTPS-TLS/main.go
type User (line 14) | type User struct
function init (line 22) | func init() {
function Home (line 35) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 43) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 47) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function checkUserName (line 51) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 70) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/12_error-handling/main.go
type User (line 15) | type User struct
function init (line 23) | func init() {
function Home (line 36) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 44) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 48) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function checkUserName (line 52) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 71) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/13_login_unfinished/main.go
type User (line 15) | type User struct
function init (line 23) | func init() {
function Home (line 36) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 44) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 48) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function checkUserName (line 52) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 71) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/14_code-review/main.go
type User (line 17) | type User struct
function init (line 25) | func init() {
function Home (line 38) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 42) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 46) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function checkUserName (line 50) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 69) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/15_memcache-home/main.go
type User (line 17) | type User struct
function init (line 25) | func init() {
function Home (line 38) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 54) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 58) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function checkUserName (line 62) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 81) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/16_abstract-memcache-code/main.go
type User (line 17) | type User struct
function init (line 25) | func init() {
function Home (line 38) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function memTemplate (line 42) | func memTemplate(res http.ResponseWriter, req *http.Request, memKey, tem...
function Login (line 58) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 62) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function checkUserName (line 66) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 85) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/17_memcache-templates/main.go
type User (line 14) | type User struct
function init (line 22) | func init() {
function Home (line 35) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 39) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 43) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function checkUserName (line 47) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 66) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/17_memcache-templates/memcache.go
function memTemplate (line 11) | func memTemplate(res http.ResponseWriter, req *http.Request, memKey, tem...
FILE: 27_code-in-process/56_twitter/18_abstract-API-Model/API/users.go
function CheckUserName (line 14) | func CheckUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function CreateUser (line 33) | func CreateUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/18_abstract-API-Model/Memcache/templates.go
function Template (line 12) | func Template(res http.ResponseWriter, req *http.Request, memKey, templa...
FILE: 27_code-in-process/56_twitter/18_abstract-API-Model/Model/users.go
type User (line 3) | type User struct
FILE: 27_code-in-process/56_twitter/18_abstract-API-Model/main.go
function init (line 14) | func init() {
function Home (line 27) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 31) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 35) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/19_abstract-API-Model_AE-fix/API/users.go
function CheckUserName (line 14) | func CheckUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function CreateUser (line 33) | func CreateUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/19_abstract-API-Model_AE-fix/App/main.go
function init (line 13) | func init() {
function Home (line 26) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 30) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 34) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/19_abstract-API-Model_AE-fix/Memcache/templates.go
function Template (line 12) | func Template(res http.ResponseWriter, req *http.Request, memKey, templa...
FILE: 27_code-in-process/56_twitter/19_abstract-API-Model_AE-fix/Model/users.go
type User (line 3) | type User struct
FILE: 27_code-in-process/56_twitter/20_reverting_to_only_package-main/main.go
type User (line 9) | type User struct
function init (line 17) | func init() {
function Home (line 30) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 34) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 38) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/20_reverting_to_only_package-main/memcache.go
function memTemplate (line 11) | func memTemplate(res http.ResponseWriter, req *http.Request, memKey, tem...
FILE: 27_code-in-process/56_twitter/20_reverting_to_only_package-main/userCreation.go
function checkUserName (line 13) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 32) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/21_set-cookie_no-PATH/main.go
type User (line 9) | type User struct
function init (line 17) | func init() {
function Home (line 30) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 38) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 46) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/21_set-cookie_no-PATH/memcache.go
function memTemplate (line 11) | func memTemplate(res http.ResponseWriter, req *http.Request, memKey, tem...
FILE: 27_code-in-process/56_twitter/21_set-cookie_no-PATH/userCreation.go
function checkUserName (line 13) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 32) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/22_set-cookie_PATH/main.go
type User (line 9) | type User struct
function init (line 17) | func init() {
function Home (line 30) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 34) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 38) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/22_set-cookie_PATH/memcache.go
function memTemplate (line 11) | func memTemplate(res http.ResponseWriter, req *http.Request, memKey, tem...
FILE: 27_code-in-process/56_twitter/22_set-cookie_PATH/userCreation.go
function checkUserName (line 13) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 32) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/23_set-cookie-UUID/main.go
type User (line 9) | type User struct
function init (line 17) | func init() {
function Home (line 30) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 34) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 38) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/23_set-cookie-UUID/memcache.go
function memTemplate (line 11) | func memTemplate(res http.ResponseWriter, req *http.Request, memKey, tem...
FILE: 27_code-in-process/56_twitter/23_set-cookie-UUID/userCreation.go
function checkUserName (line 16) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 35) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/24_session/main.go
function init (line 14) | func init() {
function Home (line 27) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 46) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 50) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/24_session/memcache.go
function memTemplate (line 11) | func memTemplate(res http.ResponseWriter, req *http.Request, memKey, tem...
FILE: 27_code-in-process/56_twitter/24_session/model.go
type User (line 3) | type User struct
type templateData (line 9) | type templateData struct
FILE: 27_code-in-process/56_twitter/24_session/session.go
function loggedIn (line 10) | func loggedIn(req *http.Request) *memcache.Item {
FILE: 27_code-in-process/56_twitter/24_session/userCreation.go
function checkUserName (line 17) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 36) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/25_session-all-pages/main.go
function init (line 11) | func init() {
function Home (line 24) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 28) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 32) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/25_session-all-pages/model.go
type User (line 3) | type User struct
type sessionData (line 9) | type sessionData struct
FILE: 27_code-in-process/56_twitter/25_session-all-pages/session.go
function getSession (line 10) | func getSession(req *http.Request) *memcache.Item {
FILE: 27_code-in-process/56_twitter/25_session-all-pages/template.go
function serveTemplate (line 12) | func serveTemplate(res http.ResponseWriter, req *http.Request, pageKey, ...
FILE: 27_code-in-process/56_twitter/25_session-all-pages/userCreation.go
function checkUserName (line 17) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 36) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
FILE: 27_code-in-process/56_twitter/26_login/api.go
function checkUserName (line 17) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 36) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function login (line 56) | func login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function createSession (line 76) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
FILE: 27_code-in-process/56_twitter/26_login/main.go
function init (line 11) | func init() {
function Home (line 25) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 29) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 33) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/26_login/model.go
type User (line 3) | type User struct
type sessionData (line 9) | type sessionData struct
FILE: 27_code-in-process/56_twitter/26_login/session.go
function getSession (line 10) | func getSession(req *http.Request) *memcache.Item {
FILE: 27_code-in-process/56_twitter/26_login/template.go
function serveTemplate (line 12) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/27_logout/api.go
function checkUserName (line 17) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 36) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function login (line 56) | func login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function createSession (line 76) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 106) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/27_logout/main.go
function init (line 11) | func init() {
function Home (line 26) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 30) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 34) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/27_logout/model.go
type User (line 3) | type User struct
type sessionData (line 9) | type sessionData struct
FILE: 27_code-in-process/56_twitter/27_logout/session.go
function getSession (line 10) | func getSession(req *http.Request) *memcache.Item {
FILE: 27_code-in-process/56_twitter/27_logout/template.go
function serveTemplate (line 12) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/28_code-review/api.go
function checkUserName (line 17) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 36) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 56) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 76) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 106) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/28_code-review/main.go
function init (line 11) | func init() {
function Home (line 26) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 30) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 34) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/28_code-review/model.go
type User (line 3) | type User struct
type SessionData (line 9) | type SessionData struct
FILE: 27_code-in-process/56_twitter/28_code-review/session.go
function getSession (line 9) | func getSession(req *http.Request) *memcache.Item {
FILE: 27_code-in-process/56_twitter/28_code-review/template.go
function serveTemplate (line 12) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/29_password-encryption/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/29_password-encryption/main.go
function init (line 11) | func init() {
function Home (line 26) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 30) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 34) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/29_password-encryption/model.go
type User (line 3) | type User struct
type SessionData (line 9) | type SessionData struct
FILE: 27_code-in-process/56_twitter/29_password-encryption/session.go
function getSession (line 9) | func getSession(req *http.Request) *memcache.Item {
FILE: 27_code-in-process/56_twitter/29_password-encryption/template.go
function serveTemplate (line 12) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/30_turn-off-memcache/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/30_turn-off-memcache/main.go
function init (line 11) | func init() {
function Home (line 26) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 30) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 34) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/30_turn-off-memcache/model.go
type User (line 3) | type User struct
type SessionData (line 9) | type SessionData struct
FILE: 27_code-in-process/56_twitter/30_turn-off-memcache/session.go
function getSession (line 9) | func getSession(req *http.Request) *memcache.Item {
FILE: 27_code-in-process/56_twitter/30_turn-off-memcache/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/31_modal-post-tweet/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/31_modal-post-tweet/main.go
function init (line 11) | func init() {
function Home (line 26) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 30) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 34) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/31_modal-post-tweet/model.go
type User (line 3) | type User struct
type SessionData (line 9) | type SessionData struct
FILE: 27_code-in-process/56_twitter/31_modal-post-tweet/session.go
function getSession (line 9) | func getSession(req *http.Request) *memcache.Item {
FILE: 27_code-in-process/56_twitter/31_modal-post-tweet/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/32_tweets/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function tweetProcess (line 139) | func tweetProcess(res http.ResponseWriter, req *http.Request, _ httprout...
FILE: 27_code-in-process/56_twitter/32_tweets/main.go
function init (line 11) | func init() {
function Home (line 27) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 31) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 35) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/32_tweets/model.go
type User (line 5) | type User struct
type SessionData (line 11) | type SessionData struct
type Tweet (line 17) | type Tweet struct
FILE: 27_code-in-process/56_twitter/32_tweets/session.go
function getSession (line 9) | func getSession(req *http.Request) (*memcache.Item, error) {
FILE: 27_code-in-process/56_twitter/32_tweets/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/33_display-all-tweets/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function tweetProcess (line 139) | func tweetProcess(res http.ResponseWriter, req *http.Request, _ httprout...
FILE: 27_code-in-process/56_twitter/33_display-all-tweets/main.go
function init (line 12) | func init() {
function Home (line 28) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 47) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 51) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/33_display-all-tweets/model.go
type User (line 5) | type User struct
type SessionData (line 11) | type SessionData struct
type Tweet (line 18) | type Tweet struct
FILE: 27_code-in-process/56_twitter/33_display-all-tweets/session.go
function getSession (line 9) | func getSession(req *http.Request) (*memcache.Item, error) {
FILE: 27_code-in-process/56_twitter/33_display-all-tweets/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/33_display-all-tweets/tweets.go
function putTweet (line 9) | func putTweet(req *http.Request, user *User, tweet *Tweet) error {
function getTweets (line 17) | func getTweets(req *http.Request, user *User) ([]Tweet, error) {
FILE: 27_code-in-process/56_twitter/34_humanize/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function tweetProcess (line 139) | func tweetProcess(res http.ResponseWriter, req *http.Request, _ httprout...
FILE: 27_code-in-process/56_twitter/34_humanize/main.go
function init (line 13) | func init() {
function Home (line 35) | func Home(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function Login (line 52) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 56) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/34_humanize/model.go
type User (line 5) | type User struct
type SessionData (line 11) | type SessionData struct
type Tweet (line 18) | type Tweet struct
FILE: 27_code-in-process/56_twitter/34_humanize/session.go
function getSession (line 9) | func getSession(req *http.Request) (*memcache.Item, error) {
FILE: 27_code-in-process/56_twitter/34_humanize/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/34_humanize/tweets.go
function putTweet (line 9) | func putTweet(req *http.Request, user *User, tweet *Tweet) error {
function getTweets (line 17) | func getTweets(req *http.Request, user *User) ([]Tweet, error) {
FILE: 27_code-in-process/56_twitter/35_schmidt-params/01/main.go
function Index (line 10) | func Index(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
function Hello (line 14) | func Hello(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
function main (line 18) | func main() {
FILE: 27_code-in-process/56_twitter/35_schmidt-params/02/main.go
function Index (line 10) | func Index(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
function Hello (line 14) | func Hello(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
function main (line 18) | func main() {
FILE: 27_code-in-process/56_twitter/35_schmidt-params/03/main.go
function Index (line 10) | func Index(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
function main (line 19) | func main() {
FILE: 27_code-in-process/56_twitter/35_schmidt-params/04/main.go
function Index (line 10) | func Index(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
function main (line 19) | func main() {
FILE: 27_code-in-process/56_twitter/35_schmidt-params/05/main.go
function Index (line 10) | func Index(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
function main (line 19) | func main() {
FILE: 27_code-in-process/56_twitter/36_user-tweets/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function tweetProcess (line 139) | func tweetProcess(res http.ResponseWriter, req *http.Request, _ httprout...
FILE: 27_code-in-process/56_twitter/36_user-tweets/main.go
function init (line 13) | func init() {
function Home (line 36) | func Home(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function Login (line 60) | func Login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function Signup (line 64) | func Signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/36_user-tweets/model.go
type User (line 5) | type User struct
type SessionData (line 11) | type SessionData struct
type Tweet (line 18) | type Tweet struct
FILE: 27_code-in-process/56_twitter/36_user-tweets/session.go
function getSession (line 9) | func getSession(req *http.Request) (*memcache.Item, error) {
FILE: 27_code-in-process/56_twitter/36_user-tweets/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/36_user-tweets/tweets.go
function putTweet (line 10) | func putTweet(req *http.Request, user *User, tweet *Tweet) error {
function getTweets (line 18) | func getTweets(req *http.Request, user *User) ([]Tweet, error) {
FILE: 27_code-in-process/56_twitter/37_other-implementations/01_daniel/data.go
function getProfileByEmail (line 12) | func getProfileByEmail(ctx context.Context, email string) (*profile, err...
function getProfileByUsername (line 22) | func getProfileByUsername(ctx context.Context, usr string) (*profile, er...
function itemIn (line 37) | func itemIn(item string, list []string) bool {
function getMultiTweets (line 46) | func getMultiTweets(ctx context.Context, emails []string) ([]tweet, erro...
function getTweets (line 72) | func getTweets(ctx context.Context, email string) ([]tweet, error) {
function createProfile (line 94) | func createProfile(ctx context.Context, username, email string) error {
function emailUser (line 104) | func emailUser(ctx context.Context, username string, t *tweet) error {
function postTweet (line 121) | func postTweet(ctx context.Context, t *tweet, email string) error {
function addFollower (line 137) | func addFollower(ctx context.Context, currentUser *profile, newFollowed ...
function removeFollower (line 147) | func removeFollower(ctx context.Context, currentUser *profile, oldFollow...
FILE: 27_code-in-process/56_twitter/37_other-implementations/01_daniel/email.go
function parseFile (line 14) | func parseFile(ctx context.Context, mme, enc string, reader io.Reader) (...
FILE: 27_code-in-process/56_twitter/37_other-implementations/01_daniel/main.go
type profile (line 18) | type profile struct
type tweet (line 24) | type tweet struct
type mainpageData (line 30) | type mainpageData struct
type profileData (line 36) | type profileData struct
type loginData (line 43) | type loginData struct
constant minUsernameSize (line 49) | minUsernameSize = 5
constant maxUsernameSize (line 50) | maxUsernameSize = 20
constant tweetSize (line 51) | tweetSize = 140
constant loginDuration (line 52) | loginDuration = 60 * 60 * 24
function init (line 57) | func init() {
function getCurrentUser (line 71) | func getCurrentUser(req *http.Request) *profile {
function confirmCreateProfile (line 91) | func confirmCreateProfile(ctx context.Context, username string) bool {
function incomingMail (line 97) | func incomingMail(res http.ResponseWriter, req *http.Request) {
function handleTweet (line 135) | func handleTweet(res http.ResponseWriter, req *http.Request) {
function handleLogin (line 169) | func handleLogin(res http.ResponseWriter, req *http.Request) {
function handleLogout (line 218) | func handleLogout(res http.ResponseWriter, req *http.Request) {
function handleCreateProfile (line 223) | func handleCreateProfile(res http.ResponseWriter, req *http.Request) {
function getProfile (line 261) | func getProfile(res http.ResponseWriter, req *http.Request) {
function handle (line 318) | func handle(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/56_twitter/37_other-implementations/02_tommy/data.go
type Scream (line 14) | type Scream struct
function createScream (line 22) | func createScream(ctx context.Context, scream *Scream) error {
function getScreams (line 39) | func getScreams(ctx context.Context, username string) ([]*Scream, error) {
type Profile (line 60) | type Profile struct
function getProfile (line 66) | func getProfile(ctx context.Context, email string) (*Profile, error) {
function getProfileByUsername (line 72) | func getProfileByUsername(ctx context.Context, username string) (*Profil...
function createProfile (line 85) | func createProfile(ctx context.Context, profile *Profile) error {
function follow (line 90) | func follow(ctx context.Context, email string, followee string) error {
function scanString (line 107) | func scanString(message string) string {
function sendMail (line 117) | func sendMail(ctx context.Context, mentionProfile *Profile) error {
FILE: 27_code-in-process/56_twitter/37_other-implementations/02_tommy/handlers.go
function profileHandler (line 13) | func profileHandler(res http.ResponseWriter, req *http.Request) {
function homeHandler (line 16) | func homeHandler(res http.ResponseWriter, req *http.Request) {
function loginHandler (line 24) | func loginHandler(res http.ResponseWriter, req *http.Request) {
function logoutHandler (line 46) | func logoutHandler(res http.ResponseWriter, req *http.Request) {
function tweetHandler (line 51) | func tweetHandler(res http.ResponseWriter, req *http.Request) {
function followHandler (line 99) | func followHandler(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/56_twitter/37_other-implementations/02_tommy/main.go
function init (line 5) | func init() {
FILE: 27_code-in-process/56_twitter/37_other-implementations/02_tommy/render.go
function renderHome (line 8) | func renderHome(res http.ResponseWriter, req *http.Request) {
function renderProfile (line 19) | func renderProfile(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/56_twitter/37_other-implementations/03_t/data.go
type Profile (line 13) | type Profile struct
type Tweet (line 18) | type Tweet struct
function getProfileByUsername (line 25) | func getProfileByUsername(req *http.Request, username string) (*Profile,...
function getProfileByEmail (line 40) | func getProfileByEmail(ctx context.Context, email string) (*Profile, err...
function getProfile (line 51) | func getProfile(ctx context.Context) (*Profile, error) {
function createProfile (line 57) | func createProfile(req *http.Request, profile *Profile) error {
function waitForProfile (line 67) | func waitForProfile(req *http.Request, username string) error {
function putTweet (line 80) | func putTweet(ctx context.Context, tweet *Tweet, email string) error {
function userTweets (line 91) | func userTweets(ctx context.Context, email string) ([]Tweet, error) {
function recentTweets (line 101) | func recentTweets(ctx context.Context) ([]Tweet, error) {
FILE: 27_code-in-process/56_twitter/37_other-implementations/03_t/routes.go
function init (line 14) | func init() {
function home (line 24) | func home(res http.ResponseWriter, req *http.Request) {
function login (line 59) | func login(res http.ResponseWriter, req *http.Request) {
function profile (line 104) | func profile(res http.ResponseWriter, req *http.Request) {
function tweet (line 146) | func tweet(res http.ResponseWriter, req *http.Request) {
function receiveTweet (line 164) | func receiveTweet(ctx context.Context, res http.ResponseWriter, req *htt...
function logout (line 175) | func logout(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/56_twitter/37_other-implementations/03_t/templates.go
function init (line 10) | func init() {
function renderTemplate (line 14) | func renderTemplate(res http.ResponseWriter, name string, data interface...
FILE: 27_code-in-process/56_twitter/38_follow/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function tweetProcess (line 139) | func tweetProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function follow (line 171) | func follow(res http.ResponseWriter, req *http.Request, ps httprouter.Pa...
FILE: 27_code-in-process/56_twitter/38_follow/following.go
function following (line 9) | func following(follower, followee string, req *http.Request) (bool, erro...
FILE: 27_code-in-process/56_twitter/38_follow/main.go
function init (line 15) | func init() {
function home (line 40) | func home(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function user (line 61) | func user(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function login (line 90) | func login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function signup (line 94) | func signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/38_follow/model.go
type User (line 5) | type User struct
type SessionData (line 11) | type SessionData struct
type Tweet (line 20) | type Tweet struct
FILE: 27_code-in-process/56_twitter/38_follow/session.go
function getSession (line 9) | func getSession(req *http.Request) (*memcache.Item, error) {
FILE: 27_code-in-process/56_twitter/38_follow/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/38_follow/tweets.go
function putTweet (line 9) | func putTweet(req *http.Request, user *User, tweet *Tweet) error {
function getTweets (line 17) | func getTweets(req *http.Request, user *User) ([]Tweet, error) {
FILE: 27_code-in-process/56_twitter/39_unfollow/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function tweetProcess (line 139) | func tweetProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function follow (line 171) | func follow(res http.ResponseWriter, req *http.Request, ps httprouter.Pa...
function unfollow (line 203) | func unfollow(res http.ResponseWriter, req *http.Request, ps httprouter....
FILE: 27_code-in-process/56_twitter/39_unfollow/following.go
function following (line 9) | func following(follower, followee string, req *http.Request) (bool, erro...
FILE: 27_code-in-process/56_twitter/39_unfollow/main.go
function init (line 15) | func init() {
function home (line 40) | func home(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function user (line 61) | func user(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function login (line 90) | func login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function signup (line 94) | func signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/39_unfollow/model.go
type User (line 5) | type User struct
type SessionData (line 11) | type SessionData struct
type Tweet (line 20) | type Tweet struct
FILE: 27_code-in-process/56_twitter/39_unfollow/session.go
function getSession (line 9) | func getSession(req *http.Request) (*memcache.Item, error) {
FILE: 27_code-in-process/56_twitter/39_unfollow/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/39_unfollow/tweets.go
function putTweet (line 9) | func putTweet(req *http.Request, user *User, tweet *Tweet) error {
function getTweets (line 17) | func getTweets(req *http.Request, user *User) ([]Tweet, error) {
FILE: 27_code-in-process/56_twitter/40_send-email/main.go
function init (line 12) | func init() {
function handleIndex (line 16) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/56_twitter/41_twitter-send-email/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function tweetProcess (line 139) | func tweetProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function follow (line 171) | func follow(res http.ResponseWriter, req *http.Request, ps httprouter.Pa...
function unfollow (line 214) | func unfollow(res http.ResponseWriter, req *http.Request, ps httprouter....
FILE: 27_code-in-process/56_twitter/41_twitter-send-email/email.go
function followedEmail (line 11) | func followedEmail(w http.ResponseWriter, r *http.Request, recip string) {
constant confirmMessage (line 24) | confirmMessage = `
FILE: 27_code-in-process/56_twitter/41_twitter-send-email/following.go
function following (line 9) | func following(follower, followee string, req *http.Request) (bool, erro...
FILE: 27_code-in-process/56_twitter/41_twitter-send-email/main.go
function init (line 15) | func init() {
function home (line 40) | func home(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function user (line 61) | func user(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function login (line 90) | func login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function signup (line 94) | func signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/41_twitter-send-email/model.go
type User (line 5) | type User struct
type SessionData (line 11) | type SessionData struct
type Tweet (line 20) | type Tweet struct
FILE: 27_code-in-process/56_twitter/41_twitter-send-email/session.go
function getSession (line 9) | func getSession(req *http.Request) (*memcache.Item, error) {
FILE: 27_code-in-process/56_twitter/41_twitter-send-email/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/41_twitter-send-email/tweets.go
function putTweet (line 9) | func putTweet(req *http.Request, user *User, tweet *Tweet) error {
function getTweets (line 17) | func getTweets(req *http.Request, user *User) ([]Tweet, error) {
FILE: 27_code-in-process/56_twitter/42_following/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function tweetProcess (line 139) | func tweetProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function follow (line 171) | func follow(res http.ResponseWriter, req *http.Request, ps httprouter.Pa...
function unfollow (line 210) | func unfollow(res http.ResponseWriter, req *http.Request, ps httprouter....
FILE: 27_code-in-process/56_twitter/42_following/email.go
function followedEmail (line 11) | func followedEmail(w http.ResponseWriter, r *http.Request, recip string) {
constant confirmMessage (line 24) | confirmMessage = `
FILE: 27_code-in-process/56_twitter/42_following/following.go
function following (line 9) | func following(follower, followee string, req *http.Request) (bool, erro...
FILE: 27_code-in-process/56_twitter/42_following/main.go
function init (line 16) | func init() {
function home (line 42) | func home(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function user (line 63) | func user(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function fing (line 92) | func fing(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function login (line 126) | func login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function signup (line 130) | func signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/42_following/model.go
type User (line 5) | type User struct
type SessionData (line 11) | type SessionData struct
type Tweet (line 21) | type Tweet struct
type F (line 27) | type F struct
FILE: 27_code-in-process/56_twitter/42_following/session.go
function getSession (line 9) | func getSession(req *http.Request) (*memcache.Item, error) {
FILE: 27_code-in-process/56_twitter/42_following/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/42_following/tweets.go
function putTweet (line 9) | func putTweet(req *http.Request, user *User, tweet *Tweet) error {
function getTweets (line 17) | func getTweets(req *http.Request, user *User) ([]Tweet, error) {
FILE: 27_code-in-process/56_twitter/43_following-me/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function tweetProcess (line 139) | func tweetProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function follow (line 171) | func follow(res http.ResponseWriter, req *http.Request, ps httprouter.Pa...
function unfollow (line 210) | func unfollow(res http.ResponseWriter, req *http.Request, ps httprouter....
FILE: 27_code-in-process/56_twitter/43_following-me/email.go
function followedEmail (line 11) | func followedEmail(w http.ResponseWriter, r *http.Request, recip string) {
constant confirmMessage (line 24) | confirmMessage = `
FILE: 27_code-in-process/56_twitter/43_following-me/following.go
function following (line 9) | func following(follower, followee string, req *http.Request) (bool, erro...
FILE: 27_code-in-process/56_twitter/43_following-me/main.go
function init (line 16) | func init() {
function home (line 43) | func home(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function user (line 64) | func user(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function fing (line 93) | func fing(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function fingme (line 127) | func fingme(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function login (line 159) | func login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function signup (line 163) | func signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/43_following-me/model.go
type User (line 5) | type User struct
type SessionData (line 11) | type SessionData struct
type Tweet (line 21) | type Tweet struct
type F (line 27) | type F struct
FILE: 27_code-in-process/56_twitter/43_following-me/session.go
function getSession (line 9) | func getSession(req *http.Request) (*memcache.Item, error) {
FILE: 27_code-in-process/56_twitter/43_following-me/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/43_following-me/tweets.go
function putTweet (line 9) | func putTweet(req *http.Request, user *User, tweet *Tweet) error {
function getTweets (line 17) | func getTweets(req *http.Request, user *User) ([]Tweet, error) {
FILE: 27_code-in-process/56_twitter/44_code-review/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function tweetProcess (line 139) | func tweetProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function follow (line 171) | func follow(res http.ResponseWriter, req *http.Request, ps httprouter.Pa...
function unfollow (line 210) | func unfollow(res http.ResponseWriter, req *http.Request, ps httprouter....
FILE: 27_code-in-process/56_twitter/44_code-review/email.go
function followedEmail (line 11) | func followedEmail(w http.ResponseWriter, r *http.Request, email string) {
constant confirmMessage (line 24) | confirmMessage = `
FILE: 27_code-in-process/56_twitter/44_code-review/following.go
function following (line 9) | func following(follower, followee string, req *http.Request) (bool, erro...
FILE: 27_code-in-process/56_twitter/44_code-review/main.go
function init (line 16) | func init() {
function home (line 43) | func home(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function user (line 64) | func user(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function fing (line 93) | func fing(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function fingme (line 123) | func fingme(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function login (line 151) | func login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function signup (line 155) | func signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/56_twitter/44_code-review/model.go
type User (line 5) | type User struct
type SessionData (line 11) | type SessionData struct
type Tweet (line 21) | type Tweet struct
type F (line 27) | type F struct
FILE: 27_code-in-process/56_twitter/44_code-review/session.go
function getSession (line 9) | func getSession(req *http.Request) (*memcache.Item, error) {
FILE: 27_code-in-process/56_twitter/44_code-review/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/56_twitter/44_code-review/tweets.go
function putTweet (line 9) | func putTweet(req *http.Request, user *User, tweet *Tweet) error {
function getTweets (line 17) | func getTweets(req *http.Request, user *User) ([]Tweet, error) {
FILE: 27_code-in-process/57_appengine-channel/01_basic/channel.go
function init (line 11) | func init() {
function handleSend (line 18) | func handleSend(res http.ResponseWriter, req *http.Request) {
function handleCreateChannel (line 28) | func handleCreateChannel(res http.ResponseWriter, req *http.Request) {
function handleListen (line 38) | func handleListen(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/57_appengine-channel/02_chat-room/handlers.go
type API (line 14) | type API struct
method ServeHTTP (line 26) | func (api *API) ServeHTTP(res http.ResponseWriter, req *http.Request) {
method handlePostChannel (line 60) | func (api *API) handlePostChannel(res http.ResponseWriter, req *http.R...
method handlePostMessage (line 80) | func (api *API) handlePostMessage(res http.ResponseWriter, req *http.R...
function NewAPI (line 19) | func NewAPI(root string) *API {
FILE: 27_code-in-process/57_appengine-channel/02_chat-room/public/main.js
function apiRequest (line 2) | function apiRequest(method, endpoint, data, callback) {
function sendMessage (line 29) | function sendMessage(text, callback) {
function onMessage (line 36) | function onMessage(message) {
FILE: 27_code-in-process/57_appengine-channel/02_chat-room/room.go
type Room (line 8) | type Room struct
function getRoom (line 12) | func getRoom(ctx context.Context) (*Room, error) {
function putRoom (line 19) | func putRoom(ctx context.Context, room *Room) error {
FILE: 27_code-in-process/57_appengine-channel/02_chat-room/routes.go
function init (line 5) | func init() {
FILE: 27_code-in-process/58_appengine-search/search.go
function init (line 11) | func init() {
type Document (line 17) | type Document struct
function handleSearch (line 22) | func handleSearch(res http.ResponseWriter, req *http.Request) {
function handleGet (line 44) | func handleGet(res http.ResponseWriter, req *http.Request) {
function handlePut (line 60) | func handlePut(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/59_appengine-GCS-storage/01_NewWriter_PEM-auth/storage.go
function init (line 16) | func init() {
function handlePut (line 21) | func handlePut(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/59_appengine-GCS-storage/02_NewWriter_JSON-auth/storage.go
constant gcsBucket (line 10) | gcsBucket = "learning-1130-bucket-01"
function init (line 12) | func init() {
function handlePut (line 16) | func handlePut(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/59_appengine-GCS-storage/03_put-get-list_JSON-auth/storage.go
constant gcsBucket (line 17) | gcsBucket = "learning-1130-bucket-01"
constant aeId (line 18) | aeId = "learning-1130"
function init (line 20) | func init() {
function getCloudContext (line 26) | func getCloudContext(req *http.Request) (context.Context, error) {
function handlePut (line 45) | func handlePut(res http.ResponseWriter, req *http.Request) {
function handleGet (line 61) | func handleGet(res http.ResponseWriter, req *http.Request) {
function handleList (line 78) | func handleList(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/60_movie-website/01_search/index.go
type indexModel (line 5) | type indexModel struct
function handleIndex (line 10) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/60_movie-website/01_search/newmovie.go
type newMovieModel (line 10) | type newMovieModel struct
function handleNewMovie (line 14) | func handleNewMovie(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/60_movie-website/01_search/routes.go
function init (line 5) | func init() {
FILE: 27_code-in-process/60_movie-website/01_search/search.go
type searchModel (line 10) | type searchModel struct
function handleSearch (line 15) | func handleSearch(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/60_movie-website/01_search/types.go
type Movie (line 3) | type Movie struct
FILE: 27_code-in-process/60_movie-website/02_image-upload-GCS/index.go
type indexModel (line 5) | type indexModel struct
function handleIndex (line 10) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/60_movie-website/02_image-upload-GCS/newmovie.go
constant githubAPIUrl (line 17) | githubAPIUrl = "https://api.github.com"
function renderMarkdown (line 19) | func renderMarkdown(ctx context.Context, text string) (string, error) {
type newMovieModel (line 35) | type newMovieModel struct
function handleNewMovie (line 39) | func handleNewMovie(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/60_movie-website/02_image-upload-GCS/routes.go
function init (line 10) | func init() {
function handlePosters (line 17) | func handlePosters(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/60_movie-website/02_image-upload-GCS/search.go
type searchModel (line 10) | type searchModel struct
function handleSearch (line 15) | func handleSearch(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/60_movie-website/02_image-upload-GCS/storage.go
constant gcsBucket (line 9) | gcsBucket = "learning-1130-bucket-01"
function putFile (line 11) | func putFile(ctx context.Context, name string, rdr io.Reader) error {
function getFile (line 25) | func getFile(ctx context.Context, name string) (io.ReadCloser, error) {
function getFileLink (line 35) | func getFileLink(ctx context.Context, name string) (string, error) {
FILE: 27_code-in-process/60_movie-website/02_image-upload-GCS/types.go
type Movie (line 5) | type Movie struct
FILE: 27_code-in-process/61_http-giffy/http.go
function init (line 12) | func init() {
function handleGetGif (line 16) | func handleGetGif(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/62_self-destructing-message/01/routes.go
function init (line 14) | func init() {
function handleIndex (line 20) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleMessage (line 69) | func handleMessage(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/62_self-destructing-message/02_crypto/01_nonce/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/62_self-destructing-message/02_crypto/02_encrypt/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/62_self-destructing-message/02_crypto/03_decrypt/main.go
function main (line 12) | func main() {
FILE: 27_code-in-process/62_self-destructing-message/02_crypto/04_complete/routes.go
function init (line 19) | func init() {
function encrypt (line 24) | func encrypt(decrypted string, password [32]byte) string {
function decrypt (line 31) | func decrypt(encrypted string, password [32]byte) (string, error) {
function generatePassword (line 53) | func generatePassword() [32]byte {
function handleIndex (line 60) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleMessage (line 115) | func handleMessage(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/63_GCS-filebrowser/routes.go
function init (line 13) | func init() {
function index (line 19) | func index(res http.ResponseWriter, req *http.Request) {
type browseModel (line 45) | type browseModel struct
function browse (line 52) | func browse(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/63_GCS-filebrowser/session.go
type Session (line 14) | type Session struct
function getSession (line 19) | func getSession(ctx context.Context, req *http.Request) Session {
function putSession (line 43) | func putSession(ctx context.Context, res http.ResponseWriter, session Se...
FILE: 27_code-in-process/63_GCS-filebrowser/storage.go
function listBucket (line 9) | func listBucket(ctx context.Context, bucketName, folder string) ([]strin...
function putFile (line 39) | func putFile(ctx context.Context, bucketName, fileName string, rdr io.Re...
FILE: 27_code-in-process/64_csv-example/01/routes.go
function init (line 10) | func init() {
function handleInput (line 15) | func handleInput(res http.ResponseWriter, req *http.Request) {
function handleOutput (line 30) | func handleOutput(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/64_csv-example/01/stats.go
function getData (line 13) | func getData(ctx context.Context, symbol string) {
FILE: 27_code-in-process/64_csv-example/02/routes.go
function init (line 12) | func init() {
function handleInput (line 17) | func handleInput(res http.ResponseWriter, req *http.Request) {
function handleOutput (line 35) | func handleOutput(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/64_csv-example/02/stats.go
function correlation (line 14) | func correlation(xs, ys []float64) float64 {
function covariance (line 18) | func covariance(x, y []float64) float64 {
function getData (line 40) | func getData(ctx context.Context, symbol string) ([]float64, error) {
function standardDeviation (line 85) | func standardDeviation(xs []float64) float64 {
function variance (line 89) | func variance(vector []float64) float64 {
function relativize (line 105) | func relativize(data []float64) []float64 {
FILE: 27_code-in-process/65_accepting-credit-cards/01_basic-setup/routes.go
function init (line 11) | func init() {
function handleIndex (line 16) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/65_accepting-credit-cards/02_customizing_UI/routes.go
function init (line 11) | func init() {
function handleIndex (line 16) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/65_accepting-credit-cards/03_stripe-token/routes.go
function init (line 12) | func init() {
function handleIndex (line 19) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handlePayment (line 27) | func handlePayment(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/65_accepting-credit-cards/04_err-because-of-app-engine/routes.go
function init (line 13) | func init() {
function handleIndex (line 20) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handlePayment (line 28) | func handlePayment(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/65_accepting-credit-cards/04_err-because-of-app-engine/stripe.go
function init (line 10) | func init() {
function chargeAccount (line 14) | func chargeAccount(ctx context.Context, stripeToken string) error {
FILE: 27_code-in-process/65_accepting-credit-cards/05_charging/routes.go
function init (line 13) | func init() {
function handleIndex (line 20) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handlePayment (line 28) | func handlePayment(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/65_accepting-credit-cards/05_charging/stripe.go
function init (line 11) | func init() {
function chargeAccount (line 15) | func chargeAccount(ctx context.Context, stripeToken string) error {
FILE: 27_code-in-process/65_accepting-credit-cards/06_idempotent/routes.go
function init (line 14) | func init() {
function handlePayment (line 20) | func handlePayment(res http.ResponseWriter, req *http.Request) {
function handleIndex (line 35) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/65_accepting-credit-cards/06_idempotent/stripe.go
function init (line 15) | func init() {
function chargeAccount (line 19) | func chargeAccount(ctx context.Context, stripeToken string) error {
FILE: 27_code-in-process/65_accepting-credit-cards/07_complete/routes.go
function init (line 14) | func init() {
function handlePayment (line 20) | func handlePayment(res http.ResponseWriter, req *http.Request) {
function handleIndex (line 35) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/65_accepting-credit-cards/07_complete/stripe.go
function init (line 15) | func init() {
function chargeAccount (line 19) | func chargeAccount(ctx context.Context, stripeToken string) error {
FILE: 27_code-in-process/66_authentication_OAUTH/01_app-engine-auth_REVIEW/main.go
function init (line 11) | func init() {
function index (line 16) | func index(res http.ResponseWriter, req *http.Request) {
function admin (line 29) | func admin(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/01_cookie_REVIEW/main.go
function main (line 9) | func main() {
function foo (line 14) | func foo(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/02_gorilla_REVIEW_photo-blog/01_simple/main.go
function main (line 13) | func main() {
function foo (line 18) | func foo(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/02_gorilla_REVIEW_photo-blog/02_photo-blog/main.go
function init (line 20) | func init() {
function main (line 24) | func main() {
function index (line 33) | func index(res http.ResponseWriter, req *http.Request) {
function logout (line 53) | func logout(res http.ResponseWriter, req *http.Request) {
function login (line 60) | func login(res http.ResponseWriter, req *http.Request) {
function uploadPhoto (line 72) | func uploadPhoto(src multipart.File, hdr *multipart.FileHeader, session ...
function getSha (line 84) | func getSha(src multipart.File) string {
function addPhoto (line 90) | func addPhoto(fName string, session *sessions.Session) {
function getPhotos (line 97) | func getPhotos(session *sessions.Session) []string {
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/03_memcache_REVIEW_twitter/api.go
function checkUserName (line 18) | func checkUserName(res http.ResponseWriter, req *http.Request, _ httprou...
function createUser (line 37) | func createUser(res http.ResponseWriter, req *http.Request, _ httprouter...
function loginProcess (line 63) | func loginProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function createSession (line 83) | func createSession(res http.ResponseWriter, req *http.Request, user User) {
function logout (line 113) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function tweetProcess (line 139) | func tweetProcess(res http.ResponseWriter, req *http.Request, _ httprout...
function follow (line 171) | func follow(res http.ResponseWriter, req *http.Request, ps httprouter.Pa...
function unfollow (line 210) | func unfollow(res http.ResponseWriter, req *http.Request, ps httprouter....
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/03_memcache_REVIEW_twitter/email.go
function followedEmail (line 11) | func followedEmail(w http.ResponseWriter, r *http.Request, email string) {
constant confirmMessage (line 24) | confirmMessage = `
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/03_memcache_REVIEW_twitter/following.go
function following (line 9) | func following(follower, followee string, req *http.Request) (bool, erro...
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/03_memcache_REVIEW_twitter/main.go
function init (line 16) | func init() {
function home (line 43) | func home(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function user (line 64) | func user(res http.ResponseWriter, req *http.Request, ps httprouter.Para...
function fing (line 93) | func fing(res http.ResponseWriter, req *http.Request, _ httprouter.Param...
function fingme (line 123) | func fingme(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function login (line 151) | func login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function signup (line 155) | func signup(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/03_memcache_REVIEW_twitter/model.go
type User (line 5) | type User struct
type SessionData (line 11) | type SessionData struct
type Tweet (line 21) | type Tweet struct
type F (line 27) | type F struct
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/03_memcache_REVIEW_twitter/session.go
function getSession (line 9) | func getSession(req *http.Request) (*memcache.Item, error) {
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/03_memcache_REVIEW_twitter/template.go
function serveTemplate (line 8) | func serveTemplate(res http.ResponseWriter, req *http.Request, templateN...
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/03_memcache_REVIEW_twitter/tweets.go
function putTweet (line 9) | func putTweet(req *http.Request, user *User, tweet *Tweet) error {
function getTweets (line 17) | func getTweets(req *http.Request, user *User) ([]Tweet, error) {
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/04_bcrypt/01/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/66_authentication_OAUTH/02_manual-auth/04_bcrypt/02/main.go
function main (line 8) | func main() {
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/01_authorization-code/login.go
constant redirectURI (line 15) | redirectURI = "http://localhost:8080/oauth2callback"
constant githubAPIURL (line 16) | githubAPIURL = "https://api.github.com"
function init (line 18) | func init() {
function handleIndex (line 24) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleGithubLogin (line 39) | func handleGithubLogin(res http.ResponseWriter, req *http.Request) {
function handleOauth2Callback (line 61) | func handleOauth2Callback(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/01_authorization-code/session.go
type Session (line 14) | type Session struct
function getSession (line 20) | func getSession(ctx context.Context, req *http.Request) Session {
function putSession (line 44) | func putSession(ctx context.Context, res http.ResponseWriter, session Se...
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/02_access-token/login.go
constant redirectURI (line 18) | redirectURI = "http://localhost:8080/oauth2callback"
constant githubAPIURL (line 19) | githubAPIURL = "https://api.github.com"
function init (line 21) | func init() {
function handleIndex (line 27) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleGithubLogin (line 42) | func handleGithubLogin(res http.ResponseWriter, req *http.Request) {
function handleOauth2Callback (line 64) | func handleOauth2Callback(res http.ResponseWriter, req *http.Request) {
function getAccessToken (line 88) | func getAccessToken(ctx context.Context, state, code string) (string, er...
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/02_access-token/session.go
type Session (line 14) | type Session struct
function getSession (line 20) | func getSession(ctx context.Context, req *http.Request) Session {
function putSession (line 44) | func putSession(ctx context.Context, res http.ResponseWriter, session Se...
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/03_url-ParseQuery/login.go
constant redirectURI (line 18) | redirectURI = "http://localhost:8080/oauth2callback"
constant githubAPIURL (line 19) | githubAPIURL = "https://api.github.com"
function init (line 21) | func init() {
function handleIndex (line 27) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleGithubLogin (line 42) | func handleGithubLogin(res http.ResponseWriter, req *http.Request) {
function handleOauth2Callback (line 64) | func handleOauth2Callback(res http.ResponseWriter, req *http.Request) {
function getAccessToken (line 88) | func getAccessToken(ctx context.Context, state, code string) (string, er...
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/03_url-ParseQuery/session.go
type Session (line 14) | type Session struct
function getSession (line 20) | func getSession(ctx context.Context, req *http.Request) Session {
function putSession (line 44) | func putSession(ctx context.Context, res http.ResponseWriter, session Se...
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/04_user-email/login.go
constant redirectURI (line 19) | redirectURI = "http://localhost:8080/oauth2callback"
constant githubAPIURL (line 20) | githubAPIURL = "https://api.github.com"
function init (line 22) | func init() {
function handleIndex (line 28) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleGithubLogin (line 43) | func handleGithubLogin(res http.ResponseWriter, req *http.Request) {
function handleOauth2Callback (line 65) | func handleOauth2Callback(res http.ResponseWriter, req *http.Request) {
function getAccessToken (line 96) | func getAccessToken(ctx context.Context, state, code string) (string, er...
function getEmail (line 113) | func getEmail(ctx context.Context, accessToken string) (string, error) {
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/04_user-email/session.go
type Session (line 14) | type Session struct
function getSession (line 20) | func getSession(ctx context.Context, req *http.Request) Session {
function putSession (line 44) | func putSession(ctx context.Context, res http.ResponseWriter, session Se...
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/05_configuration_scheduled-tasks_cron/login.go
function init (line 10) | func init() {
function handleIndex (line 14) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/05_configuration_scheduled-tasks_cron/scheduled.go
function init (line 10) | func init() {
function handleScheduleExample (line 14) | func handleScheduleExample(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/06-complete/github.go
constant redirectURI (line 18) | redirectURI = "http://localhost:8080/oauth2callback"
constant githubAPIURL (line 19) | githubAPIURL = "https://api.github.com"
function init (line 23) | func init() {
type GithubAPI (line 49) | type GithubAPI struct
method getUsername (line 65) | func (api *GithubAPI) getUsername() (string, error) {
method getAccessToken (line 84) | func (api *GithubAPI) getAccessToken(state, code string) (string, erro...
method getCommitSummaryStats (line 110) | func (api *GithubAPI) getCommitSummaryStats(since time.Time) (CommitSt...
method getOrganizations (line 180) | func (api *GithubAPI) getOrganizations() ([]string, error) {
method getRepositories (line 198) | func (api *GithubAPI) getRepositories(organization string) ([]string, ...
method getUserCommitShas (line 214) | func (api *GithubAPI) getUserCommitShas(organization, repository strin...
method getCommitStats (line 234) | func (api *GithubAPI) getCommitStats(organization, repository, sha str...
method makeAPIRequest (line 252) | func (api *GithubAPI) makeAPIRequest(endpoint string, values url.Value...
type CommitStats (line 55) | type CommitStats struct
function NewGithubAPI (line 59) | func NewGithubAPI(ctx context.Context) *GithubAPI {
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/06-complete/login.go
function init (line 16) | func init() {
function handleIndex (line 23) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleGithubLogin (line 38) | func handleGithubLogin(res http.ResponseWriter, req *http.Request) {
function handleOauth2Callback (line 60) | func handleOauth2Callback(res http.ResponseWriter, req *http.Request) {
function handleGithubInfo (line 96) | func handleGithubInfo(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/06-complete/scheduled.go
function init (line 10) | func init() {
function handleScheduleExample (line 14) | func handleScheduleExample(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/66_authentication_OAUTH/03_oauth-github/06-complete/session.go
type Session (line 14) | type Session struct
function getSession (line 21) | func getSession(ctx context.Context, req *http.Request) Session {
function putSession (line 45) | func putSession(ctx context.Context, res http.ResponseWriter, session Se...
FILE: 27_code-in-process/66_authentication_OAUTH/05_oauth-google/routes.go
function init (line 27) | func init() {
function handleIndex (line 35) | func handleIndex(res http.ResponseWriter, req *http.Request, _ httproute...
function handleLogin (line 45) | func handleLogin(res http.ResponseWriter, req *http.Request, _ httproute...
function handleAuthorize (line 75) | func handleAuthorize(res http.ResponseWriter, req *http.Request, _ httpr...
FILE: 27_code-in-process/66_authentication_OAUTH/05_oauth-google/session.go
constant cookieName (line 12) | cookieName = "sessionid"
type session (line 14) | type session struct
function getSession (line 19) | func getSession(ctx context.Context, req *http.Request) session {
function putSession (line 43) | func putSession(ctx context.Context, res http.ResponseWriter, s session)...
FILE: 27_code-in-process/66_authentication_OAUTH/08_oauth-dropbox/routes.go
function init (line 19) | func init() {
function handleIndex (line 27) | func handleIndex(res http.ResponseWriter, req *http.Request, _ httproute...
function handleLogin (line 37) | func handleLogin(res http.ResponseWriter, req *http.Request, _ httproute...
type dropboxData (line 61) | type dropboxData struct
function handleAuthorize (line 67) | func handleAuthorize(res http.ResponseWriter, req *http.Request, _ httpr...
function getToken (line 85) | func getToken(ctx context.Context, code string) (*dropboxData, error) {
FILE: 27_code-in-process/66_authentication_OAUTH/08_oauth-dropbox/session.go
constant cookieName (line 12) | cookieName = "sessionid"
type session (line 14) | type session struct
function getSession (line 19) | func getSession(ctx context.Context, req *http.Request) session {
function putSession (line 43) | func putSession(ctx context.Context, res http.ResponseWriter, s session)...
FILE: 27_code-in-process/67_digital-ocean_aerospike/01_helloWorld/testServer.go
function main (line 8) | func main() {
function index (line 13) | func index(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/67_digital-ocean_aerospike/02_fullsite/main.go
type user (line 18) | type user struct
function main (line 28) | func main() {
function loadUsers (line 60) | func loadUsers() {
function saveUsers (line 78) | func saveUsers() {
function index (line 90) | func index(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function loginPage (line 110) | func loginPage(res http.ResponseWriter, req *http.Request, _ httprouter....
function login (line 119) | func login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function logout (line 141) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function createPage (line 149) | func createPage(res http.ResponseWriter, req *http.Request, _ httprouter...
function create (line 158) | func create(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/67_digital-ocean_aerospike/03-aerospike/main.go
type user (line 16) | type user struct
function main (line 25) | func main() {
function index (line 54) | func index(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function loginPage (line 92) | func loginPage(res http.ResponseWriter, req *http.Request, _ httprouter....
function login (line 101) | func login(res http.ResponseWriter, req *http.Request, _ httprouter.Para...
function logout (line 149) | func logout(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
function createPage (line 157) | func createPage(res http.ResponseWriter, req *http.Request, _ httprouter...
function create (line 166) | func create(res http.ResponseWriter, req *http.Request, _ httprouter.Par...
FILE: 27_code-in-process/68_task-queue/01_delay/delayed.go
function init (line 11) | func init() {
function runLater (line 15) | func runLater(ctx context.Context) {
FILE: 27_code-in-process/68_task-queue/01_delay/routes.go
function init (line 9) | func init() {
function handleIndex (line 13) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/68_task-queue/02_delay-cron/delayed.go
function init (line 11) | func init() {
function runLater (line 15) | func runLater(ctx context.Context) {
FILE: 27_code-in-process/68_task-queue/02_delay-cron/routes.go
function init (line 8) | func init() {
function handleIndex (line 12) | func handleIndex(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/68_task-queue/02_delay-cron/scheduled.go
function init (line 10) | func init() {
function handleScheduleExample (line 14) | func handleScheduleExample(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/68_task-queue/03_github/github.go
constant redirectURI (line 17) | redirectURI = "http://localhost:8080/oauth2callback"
constant githubAPIURL (line 18) | githubAPIURL = "https://api.github.com"
function init (line 22) | func init() {
type GithubAPI (line 49) | type GithubAPI struct
method getUsername (line 65) | func (api *GithubAPI) getUsername() (string, error) {
method getAccessToken (line 84) | func (api *GithubAPI) getAccessToken(state, code string) (string, erro...
method getCommitSummaryStats (line 110) | func (api *GithubAPI) getCommitSummaryStats(since time.Time) (CommitSt...
method getOrganizations (line 180) | func (api *GithubAPI) getOrganizations() ([]string, error) {
method getRepositories (line 198) | func (api *GithubAPI) getRepositories(organization string) ([]string, ...
method getUserCommitShas (line 214) | func (api *GithubAPI) getUserCommitShas(organization, repository strin...
method getCommitStats (line 234) | func (api *GithubAPI) getCommitStats(organization, repository, sha str...
method makeAPIRequest (line 252) | func (api *GithubAPI) makeAPIRequest(endpoint string, values url.Value...
type CommitStats (line 55) | type CommitStats struct
function NewGithubAPI (line 59) | func NewGithubAPI(ctx context.Context) *GithubAPI {
FILE: 27_code-in-process/68_task-queue/03_github/login.go
function init (line 16) | func init() {
function handleIndex (line 23) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleGithubLogin (line 38) | func handleGithubLogin(res http.ResponseWriter, req *http.Request) {
function handleOauth2Callback (line 60) | func handleOauth2Callback(res http.ResponseWriter, req *http.Request) {
function handleGithubInfo (line 96) | func handleGithubInfo(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/68_task-queue/03_github/session.go
type Session (line 14) | type Session struct
function getSession (line 21) | func getSession(ctx context.Context, req *http.Request) Session {
function putSession (line 45) | func putSession(ctx context.Context, res http.ResponseWriter, session Se...
FILE: 27_code-in-process/68_task-queue/04_github-goroutines/github.go
constant redirectURI (line 17) | redirectURI = "http://localhost:8080/oauth2callback"
constant githubAPIURL (line 18) | githubAPIURL = "https://api.github.com"
function init (line 22) | func init() {
type GithubAPI (line 49) | type GithubAPI struct
method getUsername (line 65) | func (api *GithubAPI) getUsername() (string, error) {
method getAccessToken (line 84) | func (api *GithubAPI) getAccessToken(state, code string) (string, erro...
method getCommitSummaryStats (line 110) | func (api *GithubAPI) getCommitSummaryStats(since time.Time) (CommitSt...
method getOrganizations (line 180) | func (api *GithubAPI) getOrganizations() ([]string, error) {
method getRepositories (line 198) | func (api *GithubAPI) getRepositories(organization string) ([]string, ...
method getUserCommitShas (line 214) | func (api *GithubAPI) getUserCommitShas(organization, repository strin...
method getCommitStats (line 234) | func (api *GithubAPI) getCommitStats(organization, repository, sha str...
method makeAPIRequest (line 252) | func (api *GithubAPI) makeAPIRequest(endpoint string, values url.Value...
type CommitStats (line 55) | type CommitStats struct
function NewGithubAPI (line 59) | func NewGithubAPI(ctx context.Context) *GithubAPI {
FILE: 27_code-in-process/68_task-queue/04_github-goroutines/login.go
function init (line 16) | func init() {
function handleIndex (line 23) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleGithubLogin (line 38) | func handleGithubLogin(res http.ResponseWriter, req *http.Request) {
function handleOauth2Callback (line 60) | func handleOauth2Callback(res http.ResponseWriter, req *http.Request) {
function handleGithubInfo (line 96) | func handleGithubInfo(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/68_task-queue/04_github-goroutines/session.go
type Session (line 14) | type Session struct
function getSession (line 21) | func getSession(ctx context.Context, req *http.Request) Session {
function putSession (line 45) | func putSession(ctx context.Context, res http.ResponseWriter, session Se...
FILE: 27_code-in-process/68_task-queue/05_github-cron/github.go
constant redirectURI (line 17) | redirectURI = "http://localhost:8080/oauth2callback"
constant githubAPIURL (line 18) | githubAPIURL = "https://api.github.com"
function init (line 22) | func init() {
type GithubAPI (line 48) | type GithubAPI struct
method getUsername (line 64) | func (api *GithubAPI) getUsername() (string, error) {
method getAccessToken (line 83) | func (api *GithubAPI) getAccessToken(state, code string) (string, erro...
method getCommitSummaryStats (line 109) | func (api *GithubAPI) getCommitSummaryStats(since time.Time) (CommitSt...
method getOrganizations (line 179) | func (api *GithubAPI) getOrganizations() ([]string, error) {
method getRepositories (line 197) | func (api *GithubAPI) getRepositories(organization string) ([]string, ...
method getUserCommitShas (line 213) | func (api *GithubAPI) getUserCommitShas(organization, repository strin...
method getCommitStats (line 233) | func (api *GithubAPI) getCommitStats(organization, repository, sha str...
method makeAPIRequest (line 251) | func (api *GithubAPI) makeAPIRequest(endpoint string, values url.Value...
type CommitStats (line 54) | type CommitStats struct
function NewGithubAPI (line 58) | func NewGithubAPI(ctx context.Context) *GithubAPI {
FILE: 27_code-in-process/68_task-queue/05_github-cron/login.go
function init (line 16) | func init() {
function handleIndex (line 23) | func handleIndex(res http.ResponseWriter, req *http.Request) {
function handleGithubLogin (line 38) | func handleGithubLogin(res http.ResponseWriter, req *http.Request) {
function handleOauth2Callback (line 60) | func handleOauth2Callback(res http.ResponseWriter, req *http.Request) {
function handleGithubInfo (line 96) | func handleGithubInfo(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/68_task-queue/05_github-cron/scheduled.go
function init (line 10) | func init() {
function handleScheduleExample (line 14) | func handleScheduleExample(res http.ResponseWriter, req *http.Request) {
FILE: 27_code-in-process/68_task-queue/05_github-cron/session.go
type Session (line 14) | type Session struct
function getSession (line 21) | func getSession(ctx context.Context, req *http.Request) Session {
function putSession (line 45) | func putSession(ctx context.Context, res http.ResponseWriter, session Se...
FILE: 27_code-in-process/90_append-to-file/01-get-files/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/90_append-to-file/02-apply/main.go
function main (line 10) | func main() {
FILE: 27_code-in-process/97_temp/01/main.go
function main (line 9) | func main() {
FILE: 27_code-in-process/97_temp/02/main.go
function init (line 7) | func init() {
function main (line 11) | func main() {
FILE: 27_code-in-process/98-good-student-code/daniel/Week10/dropbox-api/routes.go
function init (line 19) | func init() {
type dropboxData (line 27) | type dropboxData struct
function getToken (line 33) | func getToken(ctx context.Context, code string) (*dropboxData, error) {
function handleAuthorize (line 55) | func handleAuthorize(res http.ResponseWriter, req *http.Request, _ httpr...
function handleLogin (line 73) | func handleLogin(res http.ResponseWriter, req *http.Request, _ httproute...
function handleIndex (line 97) | func handleIndex(res http.ResponseWriter, req *http.Request, _ httproute...
FILE: 27_code-in-process/98-good-student-code/daniel/Week10/dropbox-api/session.go
constant cookieName (line 12) | cookieName = "sessionid"
type session (line 14) | type session struct
function getSession (line 19) | func getSession(ctx context.Context, req *http.Request) session {
function putSession (line 44) | func putSession(ctx context.Context, res http.ResponseWriter, s session)...
FILE: 27_code-in-process/98-good-student-code/daniel/Week10/filebrowser/browse.go
type browseModel (line 14) | type browseModel struct
function handlePath (line 21) | func handlePath(res http.ResponseWriter, req *http.Request, p httprouter...
FILE: 27_code-in-process/98-good-student-code/daniel/Week10/filebrowser/credentials.go
function handleCredentials (line 12) | func handleCredentials(res http.ResponseWriter, req *http.Request, _ htt...
function handleLogin (line 22) | func handleLogin(res http.ResponseWriter, req *http.Request, _ httproute...
FILE: 27_code-in-process/98-good-student-code/daniel/Week10/filebrowser/routes.go
function init (line 12) | func init() {
FILE: 27_code-in-process/98-good-student-code/daniel/Week10/filebrowser/session.go
constant cookieName (line 12) | cookieName = "sessionid"
type session (line 14) | type session struct
function getSession (line 20) | func getSession(ctx context.Context, req *http.Request) session {
function putSession (line 45) | func putSession(ctx context.Context, res http.ResponseWriter, s session)...
FILE: 27_code-in-process/98-good-student-code/daniel/Week10/filebrowser/storage.go
constant delimiter (line 18) | delimiter = "/"
type file (line 20) | type file struct
function getCloudContext (line 26) | func getCloudContext(aeCtx context.Context, credentials string) (context...
function listFiles (line 46) | func listFiles(cctx context.Context, bucket, path string) ([]string, []s...
function getFile (line 66) | func getFile(cctx context.Context, bucket, path string) (io.ReadCloser, ...
FILE: 27_code-in-process/98-good-student-code/daniel/Week10/payment/routes.go
function init (line 16) | func init() {
function handlePayment (line 24) | func handlePayment(res http.ResponseWriter, req *http.Request, _ httprou...
function handleIndex (line 35) | func handleIndex(res http.ResponseWriter, req *http.Request, _ httproute...
FILE: 27_code-in-process/98-good-student-code/daniel/Week10/payment/stripe.go
constant secretKey (line 10) | secretKey = "sk_test_C4cVqiMxarOi7drYWgUsXmLr"
function chargeAccount (line 12) | func chargeAccount(ctx context.Context, stripeToken string) error {
FILE: 27_code-in-process/98-good-student-code/daniel/Week2/backgroundPreview/backgroundPreview.js
function changeBackground (line 1) | function changeBackground(e) {
FILE: 27_code-in-process/98-good-student-code/daniel/Week2/changingBackground/changingBackground.js
function changeBackground (line 10) | function changeBackground(delta) {
function preload (line 25) | function preload() {
FILE: 27_code-in-process/98-good-student-code/daniel/Week2/destructButton/destructButton.js
function countdown (line 4) | function countdown() {
function randomizeHitButton (line 10) | function randomizeHitButton() {
function lerp (line 16) | function lerp(start, end, interval) {
function setTimer (line 20) | function setTimer() {
function hitButton (line 62) | function hitButton() {
function abort (line 70) | function abort() {
FILE: 27_code-in-process/98-good-student-code/daniel/Week2/magic8ball/magic-ball.js
function changeImage (line 1) | function changeImage() {
FILE: 27_code-in-process/98-good-student-code/daniel/Week2/whackAMole/whackamole.js
function findMoleSize (line 11) | function findMoleSize(size) {
function sizeMoles (line 27) | function sizeMoles() {
function createMoles (line 47) | function createMoles(size) {
function clearMoles (line 66) | function clearMoles() {
function moveBossRandom (line 79) | function moveBossRandom() {
function getRelativePosition (line 86) | function getRelativePosition(element, relativeTo) {
function moveBossFarthest (line 97) | function moveBossFarthest() {
function hitBoss (line 115) | function hitBoss() {
function startBoss (line 135) | function startBoss() {
function updateScores (line 147) | function updateScores() {
function playHit (line 152) | function playHit() {
function onClickMole (line 162) | function onClickMole(e) {
function randomMole (line 181) | function randomMole() {
function onLoad (line 202) | function onLoad() {
FILE: 27_code-in-process/98-good-student-code/daniel/Week3/audioPlayer/audioPlayer.js
function onClick (line 7) | function onClick(e) {
function onSongEnd (line 30) | function onSongEnd() {
function onLoad (line 37) | function onLoad() {
FILE: 27_code-in-process/98-good-student-code/daniel/Week3/hoverPreview/hoverPreview.js
function onEnter (line 5) | function onEnter(event) {
function onMove (line 11) | function onMove(event) {
function onLeave (line 17) | function onLeave(event) {
FILE: 27_code-in-process/98-good-student-code/daniel/Week3/loadImage/loadImage.js
function onImageLoad (line 28) | function onImageLoad() {
function onClick (line 33) | function onClick(e) {
function onPageLoad (line 46) | function onPageLoad() {
FILE: 27_code-in-process/98-good-student-code/daniel/Week4/flickrFeed/flickr.js
function formatImage (line 1) | function formatImage() {
function jsonFlickrFeed (line 8) | function jsonFlickrFeed(data) {
function onClick (line 17) | function onClick(target) {
function onCloseClick (line 27) | function onCloseClick(target) {
FILE: 27_code-in-process/98-good-student-code/daniel/Week4/liveSearch/liveSearch.js
function onKeyUp (line 3) | function onKeyUp() {
function positionPeople (line 17) | function positionPeople() {
function getNames (line 30) | function getNames() {
function onLoad (line 43) | function onLoad() {
FILE: 27_code-in-process/98-good-student-code/daniel/Week5/web-components-training-exercises/breaking-shadow-dom-polyfill/webcomponents.js
function detectEval (line 99) | function detectEval() {
function assert (line 114) | function assert(b) {
function mixin (line 120) | function mixin(to, from) {
function mixinStatics (line 128) | function mixinStatics(to, from) {
function oneOf (line 145) | function oneOf(object, propertyNames) {
function defineNonEnumerableDataProperty (line 156) | function defineNonEnumerableDataProperty(object, name, value) {
function getWrapperConstructor (line 161) | function getWrapperConstructor(node) {
function addForwardingProperties (line 177) | function addForwardingProperties(nativePrototype, wrapperPrototype) {
function registerInstanceProperties (line 180) | function registerInstanceProperties(wrapperPrototype, instanceObject) {
function isEventHandlerName (line 190) | function isEventHandlerName(name) {
function isIdentifierName (line 193) | function isIdentifierName(name) {
function getGetter (line 196) | function getGetter(name) {
function getSetter (line 201) | function getSetter(name) {
function getMethod (line 206) | function getMethod(name) {
function getDescriptor (line 211) | function getDescriptor(source, name) {
function installProperty (line 222) | function installProperty(source, target, allowMethod, opt_blacklist) {
function register (line 252) | function register(nativeConstructor, wrapperConstructor, opt_instance) {
function registerInternal (line 257) | function registerInternal(nativePrototype, wrapperConstructor, opt_insta...
function isWrapperFor (line 267) | function isWrapperFor(wrapperConstructor, nativeConstructor) {
function registerObject (line 270) | function registerObject(object) {
function
Condensed preview — 1906 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,933K chars).
[
{
"path": ".gitignore",
"chars": 538,
"preview": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture spe"
},
{
"path": "01_getting-started/01_helloWorld/main.go",
"chars": 73,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"Hello world!\")\n}\n"
},
{
"path": "01_getting-started/02_numeral-systems/01_decimal/main.go",
"chars": 61,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(42)\n}\n"
},
{
"path": "01_getting-started/02_numeral-systems/02_binary/main.go",
"chars": 78,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Printf(\"%d - %b \\n\", 42, 42)\n}\n"
},
{
"path": "01_getting-started/02_numeral-systems/03_hexadecimal/main.go",
"chars": 230,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t//\tfmt.Printf(\"%d - %b - %x \\n\", 42, 42, 42)\n\t//\tfmt.Printf(\"%d - %b - %#x \\n"
},
{
"path": "01_getting-started/02_numeral-systems/04_loop/main.go",
"chars": 128,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 1000000; i < 1000100; i++ {\n\t\tfmt.Printf(\"%d \\t %b \\t %x \\n\", i, i, "
},
{
"path": "01_getting-started/03_UTF-8/main.go",
"chars": 128,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 60; i < 122; i++ {\n\t\tfmt.Printf(\"%d \\t %b \\t %x \\t %q \\n\", i, i, i, "
},
{
"path": "02_package/icomefromalaska/name2.go",
"chars": 110,
"preview": "package winniepooh\n\n// MyName will be exported because it starts with a capital letter.\nvar BearName = \"Pooh\"\n"
},
{
"path": "02_package/main/main.go",
"chars": 376,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/GoesToEleven/GolangTraining/02_package/stringutil\"\n\t\"github.com/GoesToEleven/"
},
{
"path": "02_package/stringutil/name.go",
"chars": 108,
"preview": "package stringutil\n\n// MyName will be exported because it starts with a capital letter.\nvar MyName = \"Todd\"\n"
},
{
"path": "02_package/stringutil/reverse.go",
"chars": 387,
"preview": "// Package stringutil contains utility functions for working with strings.\npackage stringutil\n\n// Reverse returns its ar"
},
{
"path": "02_package/stringutil/reverseTwo.go",
"chars": 286,
"preview": "package stringutil\n\nfunc reverseTwo(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+"
},
{
"path": "03_variables/01_shorthand/01/main.go",
"chars": 312,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\ta := 10\n\tb := \"golang\"\n\tc := 4.17\n\td := true\n\te := \"Hello\"\n\tf := `Do you lik"
},
{
"path": "03_variables/01_shorthand/02/main.go",
"chars": 312,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\ta := 10\n\tb := \"golang\"\n\tc := 4.17\n\td := true\n\te := \"Hello\"\n\tf := `Do you lik"
},
{
"path": "03_variables/02_var_zero-value/main.go",
"chars": 210,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a int\n\tvar b string\n\tvar c float64\n\tvar d bool\n\n\tfmt.Printf(\"%v \\n\", a)\n"
},
{
"path": "03_variables/03_less-emphasis/01_declare-variable/var.go",
"chars": 112,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar message string\n\tmessage = \"Hello World.\"\n\tfmt.Println(message)\n}\n"
},
{
"path": "03_variables/03_less-emphasis/02_declare-many-at-once/var.go",
"chars": 147,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar message string\n\tvar a, b, c int\n\ta = 1\n\n\tmessage = \"Hello World!\"\n\n\tfmt.P"
},
{
"path": "03_variables/03_less-emphasis/03_init-many-at-once/var.go",
"chars": 134,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar message = \"Hello World!\"\n\tvar a, b, c int = 1, 2, 3\n\n\tfmt.Println(messag"
},
{
"path": "03_variables/03_less-emphasis/04_infer-type/var.go",
"chars": 130,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar message = \"Hello World!\"\n\tvar a, b, c = 1, 2, 3\n\n\tfmt.Println(message, a"
},
{
"path": "03_variables/03_less-emphasis/05_infer-mixed-up-types/var.go",
"chars": 134,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar message = \"Hello World!\"\n\tvar a, b, c = 1, false, 3\n\n\tfmt.Println(messag"
},
{
"path": "03_variables/03_less-emphasis/06_init-shorthand/var.go",
"chars": 192,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\t// you can only do this inside a func\n\tmessage := \"Hello World!\"\n\ta, b, c :="
},
{
"path": "03_variables/03_less-emphasis/07_all-together/variables.go",
"chars": 977,
"preview": "package main\n\nimport \"fmt\"\n\nvar a = \"this is stored in the variable a\" // package scope\nvar b, c string = \"stored in"
},
{
"path": "03_variables/03_less-emphasis/08_exercise_your-name/01_oneSolution/myNameVar.go",
"chars": 92,
"preview": "package main\n\nimport \"fmt\"\n\nvar name = \"Todd\"\n\nfunc main() {\n\tfmt.Println(\"Hello \", name)\n}\n"
},
{
"path": "03_variables/03_less-emphasis/08_exercise_your-name/02_anotherSolution/myNameVar.go",
"chars": 92,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar name = \"Todd\"\n\tfmt.Println(\"Hello \", name)\n}\n"
},
{
"path": "03_variables/03_less-emphasis/08_exercise_your-name/03_anotherSolution/myNameVar.go",
"chars": 89,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tname := \"Todd\"\n\tfmt.Println(\"Hello \", name)\n}\n"
},
{
"path": "03_variables/03_less-emphasis/08_exercise_your-name/04_anotherSolution/myNameVar.go",
"chars": 127,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tname := `Todd` // back-ticks work like double-quotes\n\tfmt.Println(\"Hello \", n"
},
{
"path": "04_scope/01_package-scope/01/main.go",
"chars": 111,
"preview": "package main\n\nimport \"fmt\"\n\nvar x = 42\n\nfunc main() {\n\tfmt.Println(x)\n\tfoo()\n}\n\nfunc foo() {\n\tfmt.Println(x)\n}\n"
},
{
"path": "04_scope/01_package-scope/02_visibility/main/main.go",
"chars": 176,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/GoesToEleven/GolangTraining/04_scope/01_package-scope/02_visibility/vis\"\n)\n\nf"
},
{
"path": "04_scope/01_package-scope/02_visibility/vis/name.go",
"chars": 140,
"preview": "package vis\n\n// MyName is exported because it starts with a capital letter\nvar MyName = \"Todd\"\nvar yourName = \"Future Ro"
},
{
"path": "04_scope/01_package-scope/02_visibility/vis/printer.go",
"chars": 155,
"preview": "package vis\n\nimport \"fmt\"\n\n// PrintVar is exported because it starts with a capital letter\nfunc PrintVar() {\n\tfmt.Printl"
},
{
"path": "04_scope/02_block-scope/01_this-does-not-compile/main.go",
"chars": 153,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tx := 42\n\tfmt.Println(x)\n\tfoo()\n}\n\nfunc foo() {\n\t// no access to x\n\t// this do"
},
{
"path": "04_scope/02_block-scope/02_closure/01/main.go",
"chars": 211,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tx := 42\n\tfmt.Println(x)\n\t{\n\t\tfmt.Println(x)\n\t\ty := \"The credit belongs with t"
},
{
"path": "04_scope/02_block-scope/02_closure/02/main.go",
"chars": 349,
"preview": "package main\n\nimport \"fmt\"\n\nvar x = 0\n\nfunc increment() int {\n\tx++\n\treturn x\n}\n\nfunc main() {\n\tfmt.Println(increment())\n"
},
{
"path": "04_scope/02_block-scope/02_closure/03/main.go",
"chars": 446,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tx := 0\n\tincrement := func() int {\n\t\tx++\n\t\treturn x\n\t}\n\tfmt.Println(increment("
},
{
"path": "04_scope/02_block-scope/02_closure/04/main.go",
"chars": 401,
"preview": "package main\n\nimport \"fmt\"\n\nfunc wrapper() func() int {\n\tx := 0\n\treturn func() int {\n\t\tx++\n\t\treturn x\n\t}\n}\n\nfunc main() "
},
{
"path": "04_scope/03_order-matters/main.go",
"chars": 97,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(x)\n\tfmt.Println(y)\n\tx := 42\n}\n\nvar y = 42\n"
},
{
"path": "04_scope/04_variable-shadowing/main.go",
"chars": 219,
"preview": "package main\n\nimport \"fmt\"\n\nfunc max(x int) int {\n\treturn 42 + x\n}\n\nfunc main() {\n\tmax := max(7)\n\tfmt.Println(max) // ma"
},
{
"path": "04_scope/05_same-package/main.go",
"chars": 158,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(x)\n}\n\n// IMPORTANT\n// to run this code:\n// go run *.go\n// ---- OR"
},
{
"path": "04_scope/05_same-package/same.go",
"chars": 24,
"preview": "package main\n\nvar x = 7\n"
},
{
"path": "05_blank-identifier/01_invalid-code/main.go",
"chars": 147,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ta := \"stored in a\"\n\tb := \"stored in b\"\n\tfmt.Println(\"a - \", a)\n\t// b is not b"
},
{
"path": "05_blank-identifier/02_http-get_example/01_with-error-checking/main.go",
"chars": 293,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tres, err := http.Get(\"http://www.geekwis"
},
{
"path": "05_blank-identifier/02_http-get_example/02_no-error-checking/main.go",
"chars": 207,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tres, _ := http.Get(\"http://www.geekwiseacademy."
},
{
"path": "06_constants/01_constant/main.go",
"chars": 179,
"preview": "package main\n\nimport \"fmt\"\n\nconst p = \"death & taxes\"\n\nfunc main() {\n\n\tconst q = 42\n\n\tfmt.Println(\"p - \", p)\n\tfmt.Printl"
},
{
"path": "06_constants/02_multiple-initialization/main.go",
"chars": 129,
"preview": "package main\n\nimport \"fmt\"\n\nconst (\n\tpi = 3.14\n\tlanguage = \"Go\"\n)\n\nfunc main() {\n\tfmt.Println(pi)\n\tfmt.Println(lan"
},
{
"path": "06_constants/03_iota/main.go",
"chars": 148,
"preview": "package main\n\nimport \"fmt\"\n\nconst (\n\ta = iota // 0\n\tb = iota // 1\n\tc = iota // 2\n)\n\nfunc main() {\n\tfmt.Println(a)\n\tfmt.P"
},
{
"path": "06_constants/04_iota/main.go",
"chars": 148,
"preview": "package main\n\nimport \"fmt\"\n\nconst (\n\ta = iota // 0\n\tb // 1\n\tc // 2\n)\n\nfunc main() {\n\tfmt.Println(a)\n\tfmt.P"
},
{
"path": "06_constants/05_iota/main.go",
"chars": 252,
"preview": "package main\n\nimport \"fmt\"\n\nconst (\n\ta = iota // 0\n\tb // 1\n\tc // 2\n)\n\nconst (\n\td = iota // 0\n\te // "
},
{
"path": "06_constants/06_iota/main.go",
"chars": 157,
"preview": "package main\n\nimport \"fmt\"\n\nconst (\n\t_ = iota // 0\n\tb = iota * 10 // 1 * 10\n\tc = iota * 10 // 2 * 10\n)\n\nfunc main()"
},
{
"path": "06_constants/07_iota/main.go",
"chars": 469,
"preview": "package main\n\nimport \"fmt\"\n\nconst (\n\t_ = iota // 0\n\tKB = 1 << (iota * 10) // 1 << (1 * 10)\n\tMB = 1 << (iota"
},
{
"path": "07_memory-address/01_showing-address/main.go",
"chars": 146,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\ta := 43\n\n\tfmt.Println(\"a - \", a)\n\tfmt.Println(\"a's memory address - \", &a)\n\t"
},
{
"path": "07_memory-address/02_using-address/main.go",
"chars": 243,
"preview": "package main\n\nimport \"fmt\"\n\nconst metersToYards float64 = 1.09361\n\nfunc main() {\n\tvar meters float64\n\tfmt.Print(\"Enter m"
},
{
"path": "08_pointers/01_referencing/main.go",
"chars": 296,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\ta := 43\n\n\tfmt.Println(a)\n\tfmt.Println(&a)\n\n\tvar b = &a\n\n\tfmt.Println(b)"
},
{
"path": "08_pointers/02_dereferencing/main.go",
"chars": 402,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\ta := 43\n\n\tfmt.Println(a) // 43\n\tfmt.Println(&a) // 0x20818a220\n\n\tvar b = &a"
},
{
"path": "08_pointers/03_using-pointers/main.go",
"chars": 712,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\ta := 43\n\n\tfmt.Println(a) // 43\n\tfmt.Println(&a) // 0x20818a220\n\n\tvar b = &a"
},
{
"path": "08_pointers/04_using-pointers/01_no-pointer/01/main.go",
"chars": 122,
"preview": "package main\n\nimport \"fmt\"\n\nfunc zero(z int) {\n\tz = 0\n}\n\nfunc main() {\n\tx := 5\n\tzero(x)\n\tfmt.Println(x) // x is still 5\n"
},
{
"path": "08_pointers/04_using-pointers/01_no-pointer/02_see-the-addresses/main.go",
"chars": 304,
"preview": "package main\n\nimport \"fmt\"\n\nfunc zero(z int) {\n\tfmt.Printf(\"%p\\n\", &z) // address in func zero\n\tfmt.Println(&z) /"
},
{
"path": "08_pointers/04_using-pointers/02_pointer/01/main.go",
"chars": 119,
"preview": "package main\n\nimport \"fmt\"\n\nfunc zero(z *int) {\n\t*z = 0\n}\n\nfunc main() {\n\tx := 5\n\tzero(&x)\n\tfmt.Println(x) // x is 0\n}\n"
},
{
"path": "08_pointers/04_using-pointers/02_pointer/02_see-the-addresses/main.go",
"chars": 152,
"preview": "package main\n\nimport \"fmt\"\n\nfunc zero(z *int) {\n\tfmt.Println(z)\n\t*z = 0\n}\n\nfunc main() {\n\tx := 5\n\tfmt.Println(&x)\n\tzero("
},
{
"path": "09_remainder/main.go",
"chars": 249,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tx := 13 % 3\n\tfmt.Println(x)\n\tif x == 1 {\n\t\tfmt.Println(\"Odd\")\n\t} else {\n\t\tfmt"
},
{
"path": "10_for-loop/01_init-condition-post/main.go",
"chars": 93,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 0; i <= 100; i++ {\n\t\tfmt.Println(i)\n\t}\n}\n"
},
{
"path": "10_for-loop/02_nested/main.go",
"chars": 132,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 0; i < 5; i++ {\n\t\tfor j := 0; j < 5; j++ {\n\t\t\tfmt.Println(i, \" - \", "
},
{
"path": "10_for-loop/03_for-condition-while-ish/main.go",
"chars": 92,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ti := 0\n\tfor i < 10 {\n\t\tfmt.Println(i)\n\t\ti++\n\t}\n}\n"
},
{
"path": "10_for-loop/04_for_no-condition/main.go",
"chars": 85,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ti := 0\n\tfor {\n\t\tfmt.Println(i)\n\t\ti++\n\t}\n}\n"
},
{
"path": "10_for-loop/05_for_break/main.go",
"chars": 113,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ti := 0\n\tfor {\n\t\tfmt.Println(i)\n\t\tif i >= 10 {\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n}\n"
},
{
"path": "10_for-loop/06_for_continue/main.go",
"chars": 145,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ti := 0\n\tfor {\n\t\ti++\n\t\tif i%2 == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Println(i)\n\t\tif i >"
},
{
"path": "10_for-loop/07_rune-loop_UTF8/01/main.go",
"chars": 649,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 250; i <= 340; i++ {\n\t\tfmt.Println(i, \" - \", string(i), \" - \", []byt"
},
{
"path": "10_for-loop/07_rune-loop_UTF8/02/main.go",
"chars": 142,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 50; i <= 140; i++ {\n\t\tfmt.Printf(\"%v - %v - %v \\n\", i, string(i), []"
},
{
"path": "11_switch-statements/01_switch/main.go",
"chars": 412,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tswitch \"Mhi\" {\n\tcase \"Daniel\":\n\t\tfmt.Println(\"Wassup Daniel\")\n\tcase \"Medhi\":\n"
},
{
"path": "11_switch-statements/02_fallthrough/main.go",
"chars": 368,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tswitch \"Marcus\" {\n\tcase \"Tim\":\n\t\tfmt.Println(\"Wassup Tim\")\n\tcase \"Jenny\":\n\t\tf"
},
{
"path": "11_switch-statements/03_multiple-evals/main.go",
"chars": 273,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tswitch \"Jenny\" {\n\tcase \"Tim\", \"Jenny\":\n\t\tfmt.Println(\"Wassup Tim, or, err, Je"
},
{
"path": "11_switch-statements/04_no-expression/main.go",
"chars": 785,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyFriendsName := \"Mar\"\n\n\tswitch {\n\tcase len(myFriendsName) == 2:\n\t\tfmt.Print"
},
{
"path": "11_switch-statements/05_on-type/type.go",
"chars": 712,
"preview": "package main\n\nimport \"fmt\"\n\n// switch on types\n// -- normally we switch on value of variable\n// -- go allows you to s"
},
{
"path": "12_if_else-if_else/01_eval-true/main.go",
"chars": 135,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tif true {\n\t\tfmt.Println(\"This ran\")\n\t}\n\n\tif false {\n\t\tfmt.Println(\"This did "
},
{
"path": "12_if_else-if_else/02_not-exclamation/main.go",
"chars": 138,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tif !true {\n\t\tfmt.Println(\"This did not run\")\n\t}\n\n\tif !false {\n\t\tfmt.Println("
},
{
"path": "12_if_else-if_else/03_init-statement/main.go",
"chars": 110,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tb := true\n\n\tif food := \"Chocolate\"; b {\n\t\tfmt.Println(food)\n\t}\n\n}\n"
},
{
"path": "12_if_else-if_else/04_init-statement_error_invalid-code/main.go",
"chars": 130,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tb := true\n\n\tif food := \"Chocolate\"; b {\n\t\tfmt.Println(food)\n\t}\n\n\tfmt.Println"
},
{
"path": "12_if_else-if_else/05_if-else/main.go",
"chars": 150,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tif false {\n\t\tfmt.Println(\"first print statement\")\n\t} else {\n\t\tfmt.Println(\"s"
},
{
"path": "12_if_else-if_else/06_if-elseif-else/main.go",
"chars": 207,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tif false {\n\t\tfmt.Println(\"first print statement\")\n\t} else if true {\n\t\tfmt.Pr"
},
{
"path": "12_if_else-if_else/07_if-elseif-elseif-else/main.go",
"chars": 267,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tif false {\n\t\tfmt.Println(\"first print statement\")\n\t} else if false {\n\t\tfmt.P"
},
{
"path": "12_if_else-if_else/08_divisibleByThree/main.go",
"chars": 114,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 0; i <= 100; i++ {\n\t\tif i%3 == 0 {\n\t\t\tfmt.Println(i)\n\t\t}\n\t}\n}\n"
},
{
"path": "13_exercise-solutions/01_hello-world/main.go",
"chars": 72,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"Hello World\")\n}\n"
},
{
"path": "13_exercise-solutions/02_hello-NAME/main.go",
"chars": 88,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tname := \"Todd\"\n\tfmt.Println(\"Hello\", name)\n}\n"
},
{
"path": "13_exercise-solutions/03_hello-user-input/main.go",
"chars": 145,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar name string\n\tfmt.Print(\"Please enter your name: \")\n\tfmt.Scan(&name)\n\tfmt."
},
{
"path": "13_exercise-solutions/04_user-enters-numbers/main.go",
"chars": 260,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar numOne int\n\tvar numTwo int\n\tfmt.Print(\"Please enter a large number: \")\n\tf"
},
{
"path": "13_exercise-solutions/05_even-numbers/main.go",
"chars": 114,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 0; i <= 100; i++ {\n\t\tif i%2 == 0 {\n\t\t\tfmt.Println(i)\n\t\t}\n\t}\n}\n"
},
{
"path": "13_exercise-solutions/06_fizzBuzz/main.go",
"chars": 266,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 0; i <= 100; i++ {\n\t\tif i%15 == 0 {\n\t\t\tfmt.Println(i, \" -- FizzBuzz\""
},
{
"path": "13_exercise-solutions/07_threeFive/main.go",
"chars": 382,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tcounter := 0\n\tfor i := 0; i < 1000; i++ {\n\t\tif i%3 == 0 {\n\t\t\tcounter += i\n\t\t}"
},
{
"path": "13_exercise-solutions/08_just-fyi/01_benchMark/bm_test.go",
"chars": 184,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc BenchmarkHello(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tfmt.Sprint"
},
{
"path": "13_exercise-solutions/08_just-fyi/02_benchMark/bm_test.go",
"chars": 272,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc BenchmarkHello(b *testing.B) {\n\tcounter := 0\n\tfor i := 0; i < b.N; i++ "
},
{
"path": "13_exercise-solutions/08_just-fyi/03_utf/main.go",
"chars": 69,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"Hello\"[1])\n}\n"
},
{
"path": "14_functions/01_main/main.go",
"chars": 117,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"Hello world!\")\n}\n\n// main is the entry point to your program\n"
},
{
"path": "14_functions/02_param-arg/main.go",
"chars": 204,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tgreet(\"Jane\")\n\tgreet(\"John\")\n}\n\nfunc greet(name string) {\n\tfmt.Println(name)\n"
},
{
"path": "14_functions/03_two-params/01/main.go",
"chars": 137,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tgreet(\"Jane\", \"Doe\")\n}\n\nfunc greet(fname string, lname string) {\n\tfmt.Println"
},
{
"path": "14_functions/03_two-params/02/main.go",
"chars": 130,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tgreet(\"Jane\", \"Doe\")\n}\n\nfunc greet(fname, lname string) {\n\tfmt.Println(fname,"
},
{
"path": "14_functions/04_return/main.go",
"chars": 157,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(greet(\"Jane \", \"Doe\"))\n}\n\nfunc greet(fname, lname string) string "
},
{
"path": "14_functions/05_return-naming/main.go",
"chars": 369,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(greet(\"Jane \", \"Doe\"))\n}\n\nfunc greet(fname string, lname string) "
},
{
"path": "14_functions/06_return-multiple/main.go",
"chars": 194,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(greet(\"Jane \", \"Doe \"))\n}\n\nfunc greet(fname, lname string) (strin"
},
{
"path": "14_functions/07_variadic-params/main.go",
"chars": 273,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn := average(43, 56, 87, 12, 45, 57)\n\tfmt.Println(n)\n}\n\nfunc average(sf ...fl"
},
{
"path": "14_functions/08_variadic-args/main.go",
"chars": 254,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tdata := []float64{43, 56, 87, 12, 45, 57}\n\tn := average(data...)\n\tfmt.Println"
},
{
"path": "14_functions/09_slice-param-arg/main.go",
"chars": 250,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tdata := []float64{43, 56, 87, 12, 45, 57}\n\tn := average(data)\n\tfmt.Println(n)"
},
{
"path": "14_functions/10_func-expression/01_before-func-expression/main.go",
"chars": 106,
"preview": "package main\n\nimport \"fmt\"\n\nfunc greeting() {\n\tfmt.Println(\"Hello world!\")\n}\n\nfunc main() {\n\tgreeting()\n}\n"
},
{
"path": "14_functions/10_func-expression/02_func-expression/main.go",
"chars": 113,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tgreeting := func() {\n\t\tfmt.Println(\"Hello world!\")\n\t}\n\n\tgreeting()\n}\n"
},
{
"path": "14_functions/10_func-expression/03_func-expression_shows-type/main.go",
"chars": 143,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tgreeting := func() {\n\t\tfmt.Println(\"Hello world!\")\n\t}\n\n\tgreeting()\n\tfmt.Prin"
},
{
"path": "14_functions/10_func-expression/04_another-way_func-expression/main.go",
"chars": 179,
"preview": "package main\n\nimport \"fmt\"\n\nfunc makeGreeter() func() string {\n\treturn func() string {\n\t\treturn \"Hello world!\"\n\t}\n}\n\nfun"
},
{
"path": "14_functions/10_func-expression/05_another-way_func-expression_shows-type/main.go",
"chars": 206,
"preview": "package main\n\nimport \"fmt\"\n\nfunc makeGreeter() func() string {\n\treturn func() string {\n\t\treturn \"Hello world!\"\n\t}\n}\n\nfun"
},
{
"path": "14_functions/11_closure/01/main.go",
"chars": 211,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tx := 42\n\tfmt.Println(x)\n\t{\n\t\tfmt.Println(x)\n\t\ty := \"The credit belongs with t"
},
{
"path": "14_functions/11_closure/02/main.go",
"chars": 349,
"preview": "package main\n\nimport \"fmt\"\n\nvar x int\n\nfunc increment() int {\n\tx++\n\treturn x\n}\n\nfunc main() {\n\tfmt.Println(increment())\n"
},
{
"path": "14_functions/11_closure/03/main.go",
"chars": 446,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tx := 0\n\tincrement := func() int {\n\t\tx++\n\t\treturn x\n\t}\n\tfmt.Println(increment("
},
{
"path": "14_functions/11_closure/04/main.go",
"chars": 404,
"preview": "package main\n\nimport \"fmt\"\n\nfunc wrapper() func() int {\n\tvar x int\n\treturn func() int {\n\t\tx++\n\t\treturn x\n\t}\n}\n\nfunc main"
},
{
"path": "14_functions/11_closure/05/main.go",
"chars": 543,
"preview": "package main\n\nimport \"fmt\"\n\nfunc wrapper() func() int {\n\tvar x int\n\treturn func() int {\n\t\tx++\n\t\treturn x\n\t}\n}\n\nfunc main"
},
{
"path": "14_functions/12_callbacks/01_print-nums/main.go",
"chars": 246,
"preview": "package main\n\nimport \"fmt\"\n\nfunc visit(numbers []int, callback func(int)) {\n\tfor _, n := range numbers {\n\t\tcallback(n)\n\t"
},
{
"path": "14_functions/12_callbacks/02_filter-nums/main.go",
"chars": 308,
"preview": "package main\n\nimport \"fmt\"\n\nfunc filter(numbers []int, callback func(int) bool) []int {\n\tvar xs []int\n\tfor _, n := range"
},
{
"path": "14_functions/13_recursion/main.go",
"chars": 156,
"preview": "package main\n\nimport \"fmt\"\n\nfunc factorial(x int) int {\n\tif x == 0 {\n\t\treturn 1\n\t}\n\treturn x * factorial(x-1)\n}\n\nfunc ma"
},
{
"path": "14_functions/14_defer/01_no-defer/main.go",
"chars": 141,
"preview": "package main\n\nimport \"fmt\"\n\nfunc hello() {\n\tfmt.Print(\"hello \")\n}\n\nfunc world() {\n\tfmt.Println(\"world\")\n}\n\nfunc main() {"
},
{
"path": "14_functions/14_defer/02_with-defer/main.go",
"chars": 147,
"preview": "package main\n\nimport \"fmt\"\n\nfunc hello() {\n\tfmt.Print(\"hello \")\n}\n\nfunc world() {\n\tfmt.Println(\"world\")\n}\n\nfunc main() {"
},
{
"path": "14_functions/15_passing-by-value/01_int/main.go",
"chars": 229,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tage := 44\n\tchangeMe(age)\n\tfmt.Println(age) // 44\n}\n\nfunc changeMe(z int) {\n\tf"
},
{
"path": "14_functions/15_passing-by-value/02_int-pointer/main.go",
"chars": 311,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tage := 44\n\tfmt.Println(&age) // 0x82023c080\n\n\tchangeMe(&age)\n\n\tfmt.Println(&"
},
{
"path": "14_functions/15_passing-by-value/03_string/main.go",
"chars": 224,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tname := \"Todd\"\n\tfmt.Println(name) // Todd\n\n\tchangeMe(name)\n\n\tfmt.Println(nam"
},
{
"path": "14_functions/15_passing-by-value/04_string-pointer/main.go",
"chars": 336,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tname := \"Todd\"\n\tfmt.Println(&name) // 0x82023c080\n\n\tchangeMe(&name)\n\n\tfmt.Pr"
},
{
"path": "14_functions/15_passing-by-value/05_REFERENCE-TYPE/main.go",
"chars": 914,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tm := make(map[string]int)\n\tchangeMe(m)\n\tfmt.Println(m[\"Todd\"]) // 44\n}\n\nfunc "
},
{
"path": "14_functions/15_passing-by-value/06_REFERENCE-TYPE/main.go",
"chars": 206,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tm := make([]string, 1, 25)\n\tfmt.Println(m) // [ ]\n\tchangeMe(m)\n\tfmt.Println(m"
},
{
"path": "14_functions/15_passing-by-value/07_struct-pointer/main.go",
"chars": 449,
"preview": "package main\n\nimport \"fmt\"\n\ntype customer struct {\n\tname string\n\tage int\n}\n\nfunc main() {\n\tc1 := customer{\"Todd\", 44}\n\t"
},
{
"path": "14_functions/16_anon_self-executing/main.go",
"chars": 89,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfunc() {\n\t\tfmt.Println(\"I'm driving!\")\n\t}()\n}\n"
},
{
"path": "15_bool-expressions/01_true-false/main.go",
"chars": 135,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tif true {\n\t\tfmt.Println(\"This ran\")\n\t}\n\n\tif false {\n\t\tfmt.Println(\"This did "
},
{
"path": "15_bool-expressions/02_not/main.go",
"chars": 138,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tif !true {\n\t\tfmt.Println(\"This did not run\")\n\t}\n\n\tif !false {\n\t\tfmt.Println("
},
{
"path": "15_bool-expressions/03_or/main.go",
"chars": 94,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tif true || false {\n\t\tfmt.Println(\"This ran\")\n\t}\n}\n"
},
{
"path": "15_bool-expressions/04_and/main.go",
"chars": 103,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tif true && false {\n\t\tfmt.Println(\"This did not run\")\n\t}\n\n}\n"
},
{
"path": "16_exercise-solutions/01_half/01/main.go",
"chars": 144,
"preview": "package main\n\nimport \"fmt\"\n\nfunc half(n int) (int, bool) {\n\treturn n / 2, n%2 == 0\n}\n\nfunc main() {\n\th, even := half(5)\n"
},
{
"path": "16_exercise-solutions/01_half/02/main.go",
"chars": 157,
"preview": "package main\n\nimport \"fmt\"\n\nfunc half(n int) (float64, bool) {\n\treturn float64(n) / 2, n%2 == 0\n}\n\nfunc main() {\n\th, eve"
},
{
"path": "16_exercise-solutions/02_func-expression/main.go",
"chars": 131,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\thalf := func(n int) (int, bool) {\n\t\treturn n / 2, n%2 == 0\n\t}\n\n\tfmt.Println("
},
{
"path": "16_exercise-solutions/03_variadic-greatest/main.go",
"chars": 856,
"preview": "package main\n\nimport \"fmt\"\n\nfunc max(numbers ...int) int {\n\tvar largest int\n\tfor _, v := range numbers {\n\t\tif v > larges"
},
{
"path": "16_exercise-solutions/04_bool-expression/main.go",
"chars": 114,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println((true && false) || (false && true) || !(false && false))\n}\n"
},
{
"path": "16_exercise-solutions/05_params-and-args/main.go",
"chars": 173,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfoo(1, 2)\n\tfoo(1, 2, 3)\n\taSlice := []int{1, 2, 3, 4}\n\tfoo(aSlice...)\n\tfoo()\n}"
},
{
"path": "17_array/01/main.go",
"chars": 149,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x [58]int\n\tfmt.Println(x)\n\tfmt.Println(len(x))\n\tfmt.Println(x[42])\n\tx[42]"
},
{
"path": "17_array/02/main.go",
"chars": 155,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x [58]string\n\n\tfor i := 65; i <= 122; i++ {\n\t\tx[i-65] = string(i)\n\t}\n\n\tfm"
},
{
"path": "17_array/03/main.go",
"chars": 237,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x [256]int\n\n\tfmt.Println(len(x))\n\tfmt.Println(x[42])\n\tfor i := 0; i < 256"
},
{
"path": "17_array/04/main.go",
"chars": 244,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x [256]byte\n\n\tfmt.Println(len(x))\n\tfmt.Println(x[42])\n\tfor i := 0; i < 25"
},
{
"path": "17_array/05/main.go",
"chars": 228,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x [256]string\n\n\tfmt.Println(len(x))\n\tfmt.Println(x[0])\n\tfor i := 0; i < 2"
},
{
"path": "18_slice/01_int-slice/main.go",
"chars": 133,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmySlice := []int{1, 3, 5, 7, 9, 11}\n\tfmt.Printf(\"%T\\n\", mySlice)\n\tfmt.Printl"
},
{
"path": "18_slice/02_int-slice/main.go",
"chars": 141,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\txs := []int{1, 3, 5, 7, 9, 11}\n\n\tfor i, value := range xs {\n\t\tfmt.Println(i,"
},
{
"path": "18_slice/03_int-slice/main.go",
"chars": 368,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmySlice := make([]int, 0, 3)\n\n\tfmt.Println(\"-----------------\")\n\tfmt.Println"
},
{
"path": "18_slice/04_string-slice/main.go",
"chars": 328,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tgreeting := []string{\n\t\t\"Good morning!\",\n\t\t\"Bonjour!\",\n\t\t\"dias!\",\n\t\t\"Bongior"
},
{
"path": "18_slice/05_slicing-a-slice/01/main.go",
"chars": 335,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar results []int\n\tfmt.Println(results)\n\n\tmySlice := []string{\"a\", \"b\", \"c\","
},
{
"path": "18_slice/05_slicing-a-slice/02/main.go",
"chars": 371,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tgreeting := []string{\n\t\t\"Good morning!\",\n\t\t\"Bonjour!\",\n\t\t\"dias!\",\n\t\t\"Bongior"
},
{
"path": "18_slice/06_make/main.go",
"chars": 698,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tcustomerNumber := make([]int, 3)\n\t// 3 is length & capacity\n\t// // length - "
},
{
"path": "18_slice/07_append-invalid/main.go",
"chars": 348,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tgreeting := make([]string, 3, 5)\n\t// 3 is length - number of elements referr"
},
{
"path": "18_slice/08_append/main.go",
"chars": 363,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tgreeting := make([]string, 3, 5)\n\t// 3 is length - number of elements referr"
},
{
"path": "18_slice/09_append-beyond-capacity/main.go",
"chars": 546,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tgreeting := make([]string, 3, 5)\n\t// 3 is length - number of elements referr"
},
{
"path": "18_slice/10_append_slice-to-slice/01_slice-of-ints/main.go",
"chars": 181,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmySlice := []int{1, 2, 3, 4, 5}\n\tmyOtherSlice := []int{6, 7, 8, 9}\n\n\tmySlice"
},
{
"path": "18_slice/10_append_slice-to-slice/02_slice-of-strings/main.go",
"chars": 216,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmySlice := []string{\"Monday\", \"Tuesday\"}\n\tmyOtherSlice := []string{\"Wednesda"
},
{
"path": "18_slice/11_delete/main.go",
"chars": 286,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmySlice := []string{\"Monday\", \"Tuesday\"}\n\tmyOtherSlice := []string{\"Wednesda"
},
{
"path": "18_slice/12_multi-dimensional/01_shorthand-slice/main.go",
"chars": 172,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tstudent := []string{}\n\tstudents := [][]string{}\n\tfmt.Println(student)\n\tf"
},
{
"path": "18_slice/12_multi-dimensional/02_var-slice/main.go",
"chars": 170,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar student []string\n\tvar students [][]string\n\tfmt.Println(student)\n\tfmt"
},
{
"path": "18_slice/12_multi-dimensional/03_make-slice/main.go",
"chars": 188,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tstudent := make([]string, 35)\n\tstudents := make([][]string, 35)\n\tfmt.Pri"
},
{
"path": "18_slice/12_multi-dimensional/04_comparing_shorthand_var_make/01_shorthand-slice/main.go",
"chars": 202,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tstudent := []string{}\n\tstudents := [][]string{}\n\tstudent[0] = \"Todd\"\n\t//"
},
{
"path": "18_slice/12_multi-dimensional/04_comparing_shorthand_var_make/02_var-slice/main.go",
"chars": 200,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar student []string\n\tvar students [][]string\n\tstudent[0] = \"Todd\"\n\t// s"
},
{
"path": "18_slice/12_multi-dimensional/04_comparing_shorthand_var_make/03_make-slice/main.go",
"chars": 218,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tstudent := make([]string, 35)\n\tstudents := make([][]string, 35)\n\tstudent"
},
{
"path": "18_slice/12_multi-dimensional/05_slice-of-slice-of-string/main.go",
"chars": 497,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar records [][]string\n\t// student 1\n\tstudent1 := make([]string, 4)\n\tstu"
},
{
"path": "18_slice/12_multi-dimensional/06_slice-of-slice-of-int/main.go",
"chars": 301,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\ttransactions := make([][]int, 0, 3)\n\n\tfor i := 0; i < 3; i++ {\n\t\ttransa"
},
{
"path": "18_slice/13_int-slice-plus-plus/main.go",
"chars": 176,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tmySlice := make([]int, 1)\n\tfmt.Println(mySlice[0])\n\tmySlice[0] = 7\n\tfmt.Print"
},
{
"path": "19_map/01_var_nil-map/main.go",
"chars": 301,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar myGreeting map[string]string\n\tfmt.Println(myGreeting)\n\tfmt.Println(myGre"
},
{
"path": "19_map/02_var_make/main.go",
"chars": 184,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar myGreeting = make(map[string]string)\n\tmyGreeting[\"Tim\"] = \"Good morning."
},
{
"path": "19_map/03_shorthand_make/main.go",
"chars": 181,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyGreeting := make(map[string]string)\n\tmyGreeting[\"Tim\"] = \"Good morning.\"\n\t"
},
{
"path": "19_map/04_shorthand_composite-literal/main.go",
"chars": 177,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyGreeting := map[string]string{}\n\tmyGreeting[\"Tim\"] = \"Good morning.\"\n\tmyGr"
},
{
"path": "19_map/05_shorthand_composite-literal/main.go",
"chars": 168,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyGreeting := map[string]string{\n\t\t\"Tim\": \"Good morning!\",\n\t\t\"Jenny\": \"Bon"
},
{
"path": "19_map/06_adding-entry/main.go",
"chars": 193,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyGreeting := map[string]string{\n\t\t\"Tim\": \"Good morning!\",\n\t\t\"Jenny\": \"Bon"
},
{
"path": "19_map/07_len/main.go",
"chars": 198,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyGreeting := map[string]string{\n\t\t\"Tim\": \"Good morning!\",\n\t\t\"Jenny\": \"Bon"
},
{
"path": "19_map/08_updating-entry/main.go",
"chars": 251,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyGreeting := map[string]string{\n\t\t\"Tim\": \"Good morning!\",\n\t\t\"Jenny\": \"Bon"
},
{
"path": "19_map/09_deleting-entry/main.go",
"chars": 263,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyGreeting := map[string]string{\n\t\t\"zero\": \"Good morning!\",\n\t\t\"one\": \"Bon"
},
{
"path": "19_map/10_comma-ok-idiom_val-exists/main.go",
"chars": 497,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyGreeting := map[int]string{\n\t\t0: \"Good morning!\",\n\t\t1: \"Bonjour!\",\n\t\t2: \"B"
},
{
"path": "19_map/11_deleting-entry_no-error/main.go",
"chars": 232,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyGreeting := map[int]string{\n\t\t0: \"Good morning!\",\n\t\t1: \"Bonjour!\",\n\t\t2: \"B"
},
{
"path": "19_map/12_comma-ok-idiom_val-not-exists/main.go",
"chars": 458,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyGreeting := map[int]string{\n\t\t0: \"Good morning!\",\n\t\t1: \"Bonjour!\",\n\t\t2: \"B"
},
{
"path": "19_map/13_loop-range/main.go",
"chars": 229,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tmyGreeting := map[int]string{\n\t\t0: \"Good morning!\",\n\t\t1: \"Bonjour!\",\n\t\t2: \"B"
},
{
"path": "19_map/14_hash-table/01_letter-buckets/01_runes-are-numbers/main.go",
"chars": 109,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tletter := 'A'\n\tfmt.Println(letter)\n\tfmt.Printf(\"%T \\n\", letter)\n}\n"
},
{
"path": "19_map/14_hash-table/01_letter-buckets/02_strings-to-rune-conversion/main.go",
"chars": 89,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tletter := rune(\"A\"[0])\n\tfmt.Println(letter)\n}\n"
},
{
"path": "19_map/14_hash-table/01_letter-buckets/03_string-index-access/main.go",
"chars": 107,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tword := \"Hello\"\n\tletter := rune(word[0])\n\tfmt.Println(letter)\n}\n"
},
{
"path": "19_map/14_hash-table/01_letter-buckets/04_remainder-bucket-selection/main.go",
"chars": 125,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 65; i <= 122; i++ {\n\t\tfmt.Println(i, \" - \", string(i), \" - \", i%12)\n"
},
{
"path": "19_map/14_hash-table/01_letter-buckets/05_hash-function/main.go",
"chars": 205,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn := hashBucket(\"Go\", 12)\n\tfmt.Println(n)\n}\n\nfunc hashBucket(word string, buc"
},
{
"path": "19_map/14_hash-table/01_letter-buckets/06_get/main.go",
"chars": 309,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tres, err := http.Get(\"http://www.gutenbe"
},
{
"path": "19_map/14_hash-table/01_letter-buckets/07_scanner/main.go",
"chars": 1187,
"preview": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\t// An artificial input source.\n\tconst input = "
},
{
"path": "19_map/14_hash-table/01_letter-buckets/08_moby-dicks-words/main.go",
"chars": 561,
"preview": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\t// get the book moby dick\n\tres, err := http."
},
{
"path": "19_map/14_hash-table/01_letter-buckets/09_int-slice-plus-plus/main.go",
"chars": 177,
"preview": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tbuckets := make([]int, 1)\n\tfmt.Println(buckets[0])\n\tbuckets[0] = 42\n\tfmt.Prin"
},
{
"path": "19_map/14_hash-table/01_letter-buckets/10_hash-letter-buckets/main.go",
"chars": 761,
"preview": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\t// get the book moby dick\n\tres, err := http."
},
{
"path": "19_map/14_hash-table/01_letter-buckets/11_hash-remainder-buckets/main.go",
"chars": 689,
"preview": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\t// get the book moby dick\n\tres, err := http."
},
{
"path": "19_map/14_hash-table/02_even-dstribution-hash/main.go",
"chars": 722,
"preview": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\t// get the book adventures of sherlock holme"
},
{
"path": "19_map/14_hash-table/03_words-in-buckets/01_slice-bucket/main.go",
"chars": 2416,
"preview": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\t// get the book adventures of sherlock holme"
},
{
"path": "19_map/14_hash-table/03_words-in-buckets/02_map-bucket/main.go",
"chars": 1085,
"preview": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\t// get the book adventures of sherlock holme"
},
{
"path": "19_map/14_hash-table/04_english-alphabet/01/main.go",
"chars": 292,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tres, err := http.Get(\"http://www-01.sil."
},
{
"path": "19_map/14_hash-table/04_english-alphabet/02/main.go",
"chars": 537,
"preview": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tres, err := http.Get(\"http://www-01.si"
},
{
"path": "20_struct/00_object-oriented/notes.txt",
"chars": 593,
"preview": "Go is Object Oriented\n\n(1) Encapsulation\nstate (\"fields\")\nbehavior (\"methods\")\nexported / un-exported\n\n(2) Reusability\ni"
},
{
"path": "20_struct/01_user-defined-types/01_alias-type_not-idiomatic/main.go",
"chars": 123,
"preview": "package main\n\nimport \"fmt\"\n\ntype foo int\n\nfunc main() {\n\tvar myAge foo\n\tmyAge = 44\n\tfmt.Printf(\"%T %v \\n\", myAge, myAge)"
},
{
"path": "20_struct/01_user-defined-types/02_static-typing/main.go",
"chars": 322,
"preview": "package main\n\nimport \"fmt\"\n\ntype foo int\n\nfunc main() {\n\tvar myAge foo\n\tmyAge = 44\n\tfmt.Printf(\"%T %v \\n\", myAge, myAge)"
},
{
"path": "20_struct/01_user-defined-types/notes.txt",
"chars": 390,
"preview": " user defined types - we declare a new type, foo\n the underlying type of foo: int\n\n conversion:int(myAge)\n converting ty"
},
{
"path": "20_struct/02_struct_fields_values_initialization/main.go",
"chars": 262,
"preview": "package main\n\nimport \"fmt\"\n\ntype person struct {\n\tfirst string\n\tlast string\n\tage int\n}\n\nfunc main() {\n\tp1 := person{\""
},
{
"path": "20_struct/02_struct_fields_values_initialization/notes.txt",
"chars": 1871,
"preview": " We used shorthand notation:\n to create a variable named p1 of type person\n to create a variable named p2 of type person"
},
{
"path": "20_struct/03_methods/main.go",
"chars": 302,
"preview": "package main\n\nimport \"fmt\"\n\ntype person struct {\n\tfirst string\n\tlast string\n\tage int\n}\n\nfunc (p person) fullName() st"
},
{
"path": "20_struct/03_methods/notes.txt",
"chars": 657,
"preview": "(p person) is the \"receiver\"\nit is another parameter\nnot idiomatic to use \"this\" or \"self\"\n\n\n\"Not many people know this,"
},
{
"path": "20_struct/04_embedded-types/main.go",
"chars": 530,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype person struct {\n\tFirst string\n\tLast string\n\tAge int\n}\n\ntype doubleZero struct {"
},
{
"path": "20_struct/05_promotion/01_overriding-fields/main.go",
"chars": 666,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype person struct {\n\tFirst string\n\tLast string\n\tAge int\n}\n\ntype doubleZero struct {"
},
{
"path": "20_struct/05_promotion/02_overriding-methods/main.go",
"chars": 528,
"preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype person struct {\n\tName string\n\tAge int\n}\n\ntype doubleZero struct {\n\tperson\n\tLicens"
}
]
// ... and 1706 more files (download for full content)
About this extraction
This page contains the full source code of the GoesToEleven/GolangTraining GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1906 files (3.4 MB), approximately 1.0M tokens, and a symbol index with 2735 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.