diff --git a/public/arrays b/public/arrays index e72e16a..90f788c 100644 --- a/public/arrays +++ b/public/arrays @@ -1,7 +1,8 @@ - + + Go by Example: Arrays @@ -202,7 +203,7 @@ typical Go. We’ll look at slices next.

diff --git a/public/atomic-counters b/public/atomic-counters index eaa9323..54794cb 100644 --- a/public/atomic-counters +++ b/public/atomic-counters @@ -1,7 +1,8 @@ - + + Go by Example: Atomic Counters @@ -230,7 +231,7 @@ state.

diff --git a/public/base64-encoding b/public/base64-encoding index 0e77c24..3099bbd 100644 --- a/public/base64-encoding +++ b/public/base64-encoding @@ -1,7 +1,8 @@ - + + Go by Example: Base64 Encoding @@ -186,7 +187,7 @@ but they both decode to the original string as desired.

diff --git a/public/channel-buffering b/public/channel-buffering index 75aa169..1689443 100644 --- a/public/channel-buffering +++ b/public/channel-buffering @@ -1,7 +1,8 @@ - + + Go by Example: Channel Buffering @@ -148,7 +149,7 @@ concurrent receive.

diff --git a/public/channel-directions b/public/channel-directions index 9b39e4c..bdcaad0 100644 --- a/public/channel-directions +++ b/public/channel-directions @@ -1,7 +1,8 @@ - + + Go by Example: Channel Directions @@ -140,7 +141,7 @@ receive on this channel.

diff --git a/public/channel-synchronization b/public/channel-synchronization index 43bd260..20e62c1 100644 --- a/public/channel-synchronization +++ b/public/channel-synchronization @@ -1,7 +1,8 @@ - + + Go by Example: Channel Synchronization @@ -179,7 +180,7 @@ started.

diff --git a/public/channels b/public/channels index de5e391..28438bc 100644 --- a/public/channels +++ b/public/channels @@ -1,7 +1,8 @@ - + + Go by Example: Channels @@ -164,7 +165,7 @@ message without having to use any other synchronization.

diff --git a/public/closing-channels b/public/closing-channels index b618e0f..d260dee 100644 --- a/public/closing-channels +++ b/public/closing-channels @@ -1,7 +1,8 @@ - + + Go by Example: Closing Channels @@ -190,7 +191,7 @@ example: range over channels.

diff --git a/public/closures b/public/closures index 6c95b57..08b4d6f 100644 --- a/public/closures +++ b/public/closures @@ -1,7 +1,8 @@ - + + Go by Example: Closures @@ -185,7 +186,7 @@ recursion.

diff --git a/public/collection-functions b/public/collection-functions index 26c2895..f7bda58 100644 --- a/public/collection-functions +++ b/public/collection-functions @@ -1,7 +1,8 @@ - + + Go by Example: Collection Functions @@ -360,7 +361,7 @@ type.

diff --git a/public/command-line-arguments b/public/command-line-arguments index bc5bcb4..a338bd5 100644 --- a/public/command-line-arguments +++ b/public/command-line-arguments @@ -1,7 +1,8 @@ - + + Go by Example: Command-Line Arguments @@ -165,7 +166,7 @@ with flags.

diff --git a/public/command-line-flags b/public/command-line-flags index 3f887d0..d4447d6 100644 --- a/public/command-line-flags +++ b/public/command-line-flags @@ -1,7 +1,8 @@ - + + Go by Example: Command-Line Flags @@ -301,7 +302,7 @@ and show the help text again.

diff --git a/public/command-line-subcommands b/public/command-line-subcommands index 0df5d04..ced641a 100644 --- a/public/command-line-subcommands +++ b/public/command-line-subcommands @@ -1,7 +1,8 @@ - + + Go by Example: Command-Line Subcommands @@ -255,7 +256,7 @@ way to parameterize programs.

diff --git a/public/constants b/public/constants index ef2146a..e6aad9f 100644 --- a/public/constants +++ b/public/constants @@ -1,7 +1,8 @@ - + + Go by Example: Constants @@ -178,7 +179,7 @@ assignment or function call. For example, here diff --git a/public/context b/public/context index 92a21e3..c5fe761 100644 --- a/public/context +++ b/public/context @@ -1,7 +1,8 @@ - + + Go by Example: Context @@ -200,7 +201,7 @@ cancellation.

diff --git a/public/defer b/public/defer index bf21b55..677d707 100644 --- a/public/defer +++ b/public/defer @@ -1,7 +1,8 @@ - + + Go by Example: Defer @@ -204,7 +205,7 @@ after being written.

diff --git a/public/directories b/public/directories index 41e52b4..d4679d0 100644 --- a/public/directories +++ b/public/directories @@ -1,7 +1,8 @@ - + + Go by Example: Directories @@ -343,7 +344,7 @@ recursively by filepath.Walk.

diff --git a/public/environment-variables b/public/environment-variables index fa21818..222d6a9 100644 --- a/public/environment-variables +++ b/public/environment-variables @@ -1,7 +1,8 @@ - + + Go by Example: Environment Variables @@ -180,7 +181,7 @@ program picks that value up.

diff --git a/public/epoch b/public/epoch index 902e82f..6977c05 100644 --- a/public/epoch +++ b/public/epoch @@ -1,7 +1,8 @@ - + + Go by Example: Epoch @@ -172,7 +173,7 @@ parsing and formatting.

diff --git a/public/errors b/public/errors index 14747be..e55c45a 100644 --- a/public/errors +++ b/public/errors @@ -1,7 +1,8 @@ - + + Go by Example: Errors @@ -291,7 +292,7 @@ on the Go blog for more on error handling.

diff --git a/public/execing-processes b/public/execing-processes index d401cee..bc6edb7 100644 --- a/public/execing-processes +++ b/public/execing-processes @@ -1,7 +1,8 @@ - + + Go by Example: Exec'ing Processes @@ -199,7 +200,7 @@ processes covers most use cases for fork.

diff --git a/public/exit b/public/exit index 7016362..f303943 100644 --- a/public/exit +++ b/public/exit @@ -1,7 +1,8 @@ - + + Go by Example: Exit diff --git a/public/file-paths b/public/file-paths index b8988de..94e7325 100644 --- a/public/file-paths +++ b/public/file-paths @@ -1,7 +1,8 @@ - + + Go by Example: File Paths @@ -244,7 +245,7 @@ be made relative to base.

diff --git a/public/for b/public/for index e88890c..1d8b2e5 100644 --- a/public/for +++ b/public/for @@ -1,7 +1,8 @@ - + + Go by Example: For @@ -190,7 +191,7 @@ structures.

diff --git a/public/functions b/public/functions index ca0f355..66573c8 100644 --- a/public/functions +++ b/public/functions @@ -1,7 +1,8 @@ - + + Go by Example: Functions @@ -187,7 +188,7 @@ multiple return values, which we’ll look at next.

diff --git a/public/goroutines b/public/goroutines index d6dacbb..8cf7474 100644 --- a/public/goroutines +++ b/public/goroutines @@ -1,7 +1,8 @@ - + + Go by Example: Goroutines @@ -202,7 +203,7 @@ concurrent Go programs: channels.

diff --git a/public/hello-world b/public/hello-world index 2454fa0..93d98e2 100644 --- a/public/hello-world +++ b/public/hello-world @@ -1,7 +1,8 @@ - + + Go by Example: Hello World diff --git a/public/http-clients b/public/http-clients index ac203be..2d3ee44 100644 --- a/public/http-clients +++ b/public/http-clients @@ -1,7 +1,8 @@ - + + Go by Example: HTTP Clients @@ -164,7 +165,7 @@ settings.

diff --git a/public/http-servers b/public/http-servers index 3a8c2c5..3aa83f6 100644 --- a/public/http-servers +++ b/public/http-servers @@ -1,7 +1,8 @@ - + + Go by Example: HTTP Servers @@ -205,7 +206,7 @@ router we’ve just set up.

diff --git a/public/if-else b/public/if-else index ebcb219..07c68e0 100644 --- a/public/if-else +++ b/public/if-else @@ -1,7 +1,8 @@ - + + Go by Example: If/Else @@ -179,7 +180,7 @@ for basic conditions.

diff --git a/public/index.html b/public/index.html index 830296d..7284a93 100644 --- a/public/index.html +++ b/public/index.html @@ -1,7 +1,8 @@ - + + Go by Example diff --git a/public/interfaces b/public/interfaces index 3ea2185..1098175 100644 --- a/public/interfaces +++ b/public/interfaces @@ -1,7 +1,8 @@ - + + Go by Example: Interfaces @@ -231,7 +232,7 @@ these structs as arguments to measure.

diff --git a/public/json b/public/json index 646402a..af9d405 100644 --- a/public/json +++ b/public/json @@ -1,7 +1,8 @@ - + + Go by Example: JSON @@ -407,7 +408,7 @@ for more.

diff --git a/public/line-filters b/public/line-filters index 65beb67..6a84b1d 100644 --- a/public/line-filters +++ b/public/line-filters @@ -1,7 +1,8 @@ - + + Go by Example: Line Filters @@ -198,7 +199,7 @@ lowercase lines.

diff --git a/public/maps b/public/maps index dca8b87..a0e0cad 100644 --- a/public/maps +++ b/public/maps @@ -1,7 +1,8 @@ - + + Go by Example: Maps @@ -228,7 +229,7 @@ printed with fmt.Println.

diff --git a/public/methods b/public/methods index a487284..563e4b8 100644 --- a/public/methods +++ b/public/methods @@ -1,7 +1,8 @@ - + + Go by Example: Methods @@ -191,7 +192,7 @@ naming related sets of methods: interfaces.

diff --git a/public/multiple-return-values b/public/multiple-return-values index 525b5cf..6955b14 100644 --- a/public/multiple-return-values +++ b/public/multiple-return-values @@ -1,7 +1,8 @@ - + + Go by Example: Multiple Return Values @@ -161,7 +162,7 @@ feature of Go functions; we’ll look at this next.

diff --git a/public/mutexes b/public/mutexes index 20d1585..f671af9 100644 --- a/public/mutexes +++ b/public/mutexes @@ -1,7 +1,8 @@ - + + Go by Example: Mutexes @@ -293,7 +294,7 @@ management task using only goroutines and channels.

diff --git a/public/non-blocking-channel-operations b/public/non-blocking-channel-operations index 49824ce..55f6e9d 100644 --- a/public/non-blocking-channel-operations +++ b/public/non-blocking-channel-operations @@ -1,7 +1,8 @@ - + + Go by Example: Non-Blocking Channel Operations @@ -171,7 +172,7 @@ on both messages and signals.

diff --git a/public/number-parsing b/public/number-parsing index 1ea9626..07f5198 100644 --- a/public/number-parsing +++ b/public/number-parsing @@ -1,7 +1,8 @@ - + + Go by Example: Number Parsing @@ -209,7 +210,7 @@ bits.

diff --git a/public/panic b/public/panic index 0de7a93..f7cd6f7 100644 --- a/public/panic +++ b/public/panic @@ -1,7 +1,8 @@ - + + Go by Example: Panic @@ -166,7 +167,7 @@ to use error-indicating return values wherever possible.

diff --git a/public/pointers b/public/pointers index eeaa55f..cffe0e3 100644 --- a/public/pointers +++ b/public/pointers @@ -1,7 +1,8 @@ - + + Go by Example: Pointers @@ -188,7 +189,7 @@ the memory address for that variable.

diff --git a/public/random-numbers b/public/random-numbers index 373b17f..78c2b90 100644 --- a/public/random-numbers +++ b/public/random-numbers @@ -1,7 +1,8 @@ - + + Go by Example: Random Numbers @@ -224,7 +225,7 @@ that Go can provide.

diff --git a/public/range b/public/range index 05a277c..84e6533 100644 --- a/public/range +++ b/public/range @@ -1,7 +1,8 @@ - + + Go by Example: Range @@ -195,7 +196,7 @@ of the rune and the second the rune itself.

diff --git a/public/range-over-channels b/public/range-over-channels index 3bb6df6..a1fd506 100644 --- a/public/range-over-channels +++ b/public/range-over-channels @@ -1,7 +1,8 @@ - + + Go by Example: Range over Channels @@ -149,7 +150,7 @@ values be received.

diff --git a/public/rate-limiting b/public/rate-limiting index e916478..bd79c4d 100644 --- a/public/rate-limiting +++ b/public/rate-limiting @@ -1,7 +1,8 @@ - + + Go by Example: Rate Limiting @@ -256,7 +257,7 @@ then serve the remaining 2 with ~200ms delays each.

diff --git a/public/reading-files b/public/reading-files index d98fcc9..aaa8235 100644 --- a/public/reading-files +++ b/public/reading-files @@ -1,7 +1,8 @@ - + + Go by Example: Reading Files @@ -282,7 +283,7 @@ be scheduled immediately after Opening with diff --git a/public/recursion b/public/recursion index f6e9bf3..d46e159 100644 --- a/public/recursion +++ b/public/recursion @@ -1,7 +1,8 @@ - + + Go by Example: Recursion @@ -120,7 +121,7 @@ base case of fact(0).

diff --git a/public/regular-expressions b/public/regular-expressions index 7141dea..cac7534 100644 --- a/public/regular-expressions +++ b/public/regular-expressions @@ -1,7 +1,8 @@ - + + Go by Example: Regular Expressions @@ -338,7 +339,7 @@ the regexp package docs diff --git a/public/select b/public/select index 9362816..64a436a 100644 --- a/public/select +++ b/public/select @@ -1,7 +1,8 @@ - + + Go by Example: Select @@ -178,7 +179,7 @@ concurrently.

diff --git a/public/sha1-hashes b/public/sha1-hashes index b70329b..f7f9fb2 100644 --- a/public/sha1-hashes +++ b/public/sha1-hashes @@ -1,7 +1,8 @@ - + + Go by Example: SHA1 Hashes @@ -200,7 +201,7 @@ you should carefully research diff --git a/public/signals b/public/signals index 237294f..4cced85 100644 --- a/public/signals +++ b/public/signals @@ -1,7 +1,8 @@ - + + Go by Example: Signals @@ -184,7 +185,7 @@ causing the program to print interrupt and then exit.

diff --git a/public/site.css b/public/site.css index 2e98415..a7c74b9 100644 --- a/public/site.css +++ b/public/site.css @@ -148,6 +148,64 @@ img.copy { margin-right: 4px; } +/* Mobile layout */ +@media only screen and (max-width: 40em) { + html { + box-sizing: border-box; + } + *, *:before, *:after { + box-sizing: inherit; + } + div#intro { + width: 100%; + min-width: auto; + max-width: none; + margin-left: auto; + margin-right: auto; + margin-bottom: 120px; + padding-left: 1rem; + padding-right: 1rem; + } + div.example { + width: 100%; + max-width: none; + min-width: auto; + padding: 1rem; + } + table, tbody, tr { + display: block; + } + td { + display: block; + } + td.docs { + width: 100%; + max-width: none; + min-width: auto; + min-height: auto; + vertical-align: top; + text-align: left; + } + td.code { + width: 100%; + max-width: none; + min-width: auto; + padding-top: 5px; + padding-right: 5px; + padding-left: 5px; + padding-bottom: 5px; + vertical-align: top; + background: #f0f0f0; + } + td.docs p:first-child { + padding-top: 15px; + padding-bottom: 5px; + } + pre { + overflow-x: auto; + } +} + /* Syntax highlighting */ body .hll { background-color: #ffffcc } body .err { border: 1px solid #FF0000 } /* Error */ diff --git a/public/slices b/public/slices index ec96eae..c7025f7 100644 --- a/public/slices +++ b/public/slices @@ -1,7 +1,8 @@ - + + Go by Example: Slices @@ -304,7 +305,7 @@ Go’s other key builtin data structure: maps.

diff --git a/public/sorting b/public/sorting index a5db6e7..2978d6d 100644 --- a/public/sorting +++ b/public/sorting @@ -1,7 +1,8 @@ - + + Go by Example: Sorting @@ -156,7 +157,7 @@ slices and true as the result of our AreSorted test. diff --git a/public/sorting-by-functions b/public/sorting-by-functions index 1e67e01..c8aaa8f 100644 --- a/public/sorting-by-functions +++ b/public/sorting-by-functions @@ -1,7 +1,8 @@ - + + Go by Example: Sorting by Functions @@ -174,7 +175,7 @@ functions.

diff --git a/public/spawning-processes b/public/spawning-processes index bc83dd7..d781c93 100644 --- a/public/spawning-processes +++ b/public/spawning-processes @@ -1,7 +1,8 @@ - + + Go by Example: Spawning Processes @@ -251,7 +252,7 @@ as if we had run them directly from the command-line.

diff --git a/public/stateful-goroutines b/public/stateful-goroutines index 984f872..5ebfc10 100644 --- a/public/stateful-goroutines +++ b/public/stateful-goroutines @@ -1,7 +1,8 @@ - + + Go by Example: Stateful Goroutines @@ -308,7 +309,7 @@ program.

diff --git a/public/string-formatting b/public/string-formatting index 49366c0..10806a5 100644 --- a/public/string-formatting +++ b/public/string-formatting @@ -1,7 +1,8 @@ - + + Go by Example: String Formatting @@ -451,7 +452,7 @@ and returns a string without printing it anywhere.

diff --git a/public/string-functions b/public/string-functions index 0a18be0..992c966 100644 --- a/public/string-functions +++ b/public/string-functions @@ -1,7 +1,8 @@ - + + Go by Example: String Functions @@ -202,7 +203,7 @@ for more information.

diff --git a/public/structs b/public/structs index 520842c..fe18305 100644 --- a/public/structs +++ b/public/structs @@ -1,7 +1,8 @@ - + + Go by Example: Structs @@ -261,7 +262,7 @@ pointers are automatically dereferenced.

diff --git a/public/switch b/public/switch index 1d3d73f..894a1a3 100644 --- a/public/switch +++ b/public/switch @@ -1,7 +1,8 @@ - + + Go by Example: Switch @@ -198,7 +199,7 @@ type corresponding to its clause.

diff --git a/public/temporary-files-and-directories b/public/temporary-files-and-directories index 65cb35f..45f3c8a 100644 --- a/public/temporary-files-and-directories +++ b/public/temporary-files-and-directories @@ -1,7 +1,8 @@ - + + Go by Example: Temporary Files and Directories @@ -235,7 +236,7 @@ prefixing them with our temporary directory.

diff --git a/public/testing b/public/testing index 02efa20..f6fd458 100644 --- a/public/testing +++ b/public/testing @@ -1,7 +1,8 @@ - + + Go by Example: Testing @@ -227,7 +228,7 @@ when executing go test -v.

diff --git a/public/tickers b/public/tickers index d8da601..6591f5e 100644 --- a/public/tickers +++ b/public/tickers @@ -1,7 +1,8 @@ - + + Go by Example: Tickers @@ -166,7 +167,7 @@ before we stop it.

diff --git a/public/time b/public/time index 9da4584..2fae5ce 100644 --- a/public/time +++ b/public/time @@ -1,7 +1,8 @@ - + + Go by Example: Time @@ -265,7 +266,7 @@ the Unix epoch.

diff --git a/public/time-formatting-parsing b/public/time-formatting-parsing index a33fa4f..87c1101 100644 --- a/public/time-formatting-parsing +++ b/public/time-formatting-parsing @@ -1,7 +1,8 @@ - + + Go by Example: Time Formatting / Parsing @@ -199,7 +200,7 @@ explaining the parsing problem.

diff --git a/public/timeouts b/public/timeouts index 7d0dee5..be0f9f7 100644 --- a/public/timeouts +++ b/public/timeouts @@ -1,7 +1,8 @@ - + + Go by Example: Timeouts @@ -177,7 +178,7 @@ out and the second succeeding.

diff --git a/public/timers b/public/timers index e34f817..3206425 100644 --- a/public/timers +++ b/public/timers @@ -1,7 +1,8 @@ - + + Go by Example: Timers @@ -180,7 +181,7 @@ a chance to fire.

diff --git a/public/url-parsing b/public/url-parsing index f021d19..d52d2ee 100644 --- a/public/url-parsing +++ b/public/url-parsing @@ -1,7 +1,8 @@ - + + Go by Example: URL Parsing @@ -231,7 +232,7 @@ pieces that we extracted.

diff --git a/public/values b/public/values index 740bae9..db4549a 100644 --- a/public/values +++ b/public/values @@ -1,7 +1,8 @@ - + + Go by Example: Values @@ -147,7 +148,7 @@ basic examples.

diff --git a/public/variables b/public/variables index 45c5aa0..4cab11e 100644 --- a/public/variables +++ b/public/variables @@ -1,7 +1,8 @@ - + + Go by Example: Variables @@ -178,7 +179,7 @@ initializing a variable, e.g. for diff --git a/public/variadic-functions b/public/variadic-functions index c71dcd8..0809366 100644 --- a/public/variadic-functions +++ b/public/variadic-functions @@ -1,7 +1,8 @@ - + + Go by Example: Variadic Functions @@ -167,7 +168,7 @@ to form closures, which we’ll look at next.

diff --git a/public/waitgroups b/public/waitgroups index 4a0d3b3..eed5ecf 100644 --- a/public/waitgroups +++ b/public/waitgroups @@ -1,7 +1,8 @@ - + + Go by Example: WaitGroups @@ -223,7 +224,7 @@ is likely to be different for each invocation.

diff --git a/public/worker-pools b/public/worker-pools index aa3077a..2b60bd6 100644 --- a/public/worker-pools +++ b/public/worker-pools @@ -1,7 +1,8 @@ - + + Go by Example: Worker Pools @@ -218,7 +219,7 @@ there are 3 workers operating concurrently.

diff --git a/public/writing-files b/public/writing-files index af4373b..4c60989 100644 --- a/public/writing-files +++ b/public/writing-files @@ -1,7 +1,8 @@ - + + Go by Example: Writing Files @@ -282,7 +283,7 @@ we’ve just seen to the stdin and stdout streams. diff --git a/public/xml b/public/xml index add0a0d..b8e9b62 100644 --- a/public/xml +++ b/public/xml @@ -1,7 +1,8 @@ - + + Go by Example: XML @@ -272,7 +273,7 @@ to nest all plants under <parent><child>...