diff --git a/examples/command-line-flags/command-line-flags.hash b/examples/command-line-flags/command-line-flags.hash index 03cb054..e3f2d05 100644 --- a/examples/command-line-flags/command-line-flags.hash +++ b/examples/command-line-flags/command-line-flags.hash @@ -1,2 +1,2 @@ -a22c44511e84451cca813659f3803fb7ae48dab0 -9xlvGqQjhl +e2ba0461c090789168c712cc7ed0f66aab09a8c8 +NASEOq2R3n diff --git a/examples/execing-processes/execing-processes.hash b/examples/execing-processes/execing-processes.hash index 9267a36..ae5a08a 100644 --- a/examples/execing-processes/execing-processes.hash +++ b/examples/execing-processes/execing-processes.hash @@ -1,2 +1,2 @@ -ae75526fdd970c450fa3ed52c70cf400a45d0770 -iEAD2cYC-h +b527bbb76a42dd4bae541b73a7377b7e83e79905 +neqdJ51KLN diff --git a/examples/functions/functions.hash b/examples/functions/functions.hash index 98b77eb..693c858 100644 --- a/examples/functions/functions.hash +++ b/examples/functions/functions.hash @@ -1,2 +1,2 @@ -19cac21e4a057e8335ce78a30de9a43c2b18d522 -2EXoOWfGf_ +ae669923c20e5ebf4a7b4b11b8fdf2972accf9e2 +9Nky-Dn49f diff --git a/examples/if-else/if-else.hash b/examples/if-else/if-else.hash index a1981ed..aefc6f9 100644 --- a/examples/if-else/if-else.hash +++ b/examples/if-else/if-else.hash @@ -1,2 +1,2 @@ -4187a4268be1cd85fdd6e9a211d1e4f534666ad6 -p_ykufAYRj +89b78f3378e1a574ddfd0260a0404a962852eff8 +g-aqMz0Ivf diff --git a/examples/random-numbers/random-numbers.hash b/examples/random-numbers/random-numbers.hash index bedcd90..85b60de 100644 --- a/examples/random-numbers/random-numbers.hash +++ b/examples/random-numbers/random-numbers.hash @@ -1,2 +1,2 @@ -62b0562c92dd84ecb9408df4c517031d75b1e337 -C0_kuFx3ET +f7ce9724ab51b3e90b8d04cf88eaaa8cf2dfd50e +X973CNW5aa diff --git a/examples/regular-expressions/regular-expressions.hash b/examples/regular-expressions/regular-expressions.hash index 98a545e..9e3526c 100644 --- a/examples/regular-expressions/regular-expressions.hash +++ b/examples/regular-expressions/regular-expressions.hash @@ -1,2 +1,2 @@ -0ebd0a44997fe20d3fa0caa8b5f2cfa96ff1db13 -7bnr2EXlxK +7cde6b9af5cf6c47606001dd54eee468a6c61dbb +YeSiBTfhFq diff --git a/examples/string-formatting/string-formatting.hash b/examples/string-formatting/string-formatting.hash index 998c0ab..c035045 100644 --- a/examples/string-formatting/string-formatting.hash +++ b/examples/string-formatting/string-formatting.hash @@ -1,2 +1,2 @@ -fece72ed980c2ee55b3f1d5d8e8d83aed81dc814 -qayRuqXHym +5f39ae6d8f26d59a688a9a9d7d13a5c1d0f7a08b +JJAAFGxHVq diff --git a/examples/time-formatting-parsing/time-formatting-parsing.hash b/examples/time-formatting-parsing/time-formatting-parsing.hash index fcb02d5..25ae213 100644 --- a/examples/time-formatting-parsing/time-formatting-parsing.hash +++ b/examples/time-formatting-parsing/time-formatting-parsing.hash @@ -1,2 +1,2 @@ -52b9bc757a1de989f28665c86ac1f84e17fc0ffc -SGS6wIVnDd +1f9962260f5c92efe57db0b96099b3dd06c90333 +BFw556nWcM diff --git a/public/command-line-flags b/public/command-line-flags index cc5d959..180d1c2 100644 --- a/public/command-line-flags +++ b/public/command-line-flags @@ -42,7 +42,7 @@ command-line flag.
package main
Here we’ll just dump out the parsed options and
any trailing positional arguments. Note that we
-need to dereference the points with e.g. *wordPtr
+need to dereference the pointers with e.g. *wordPtr
to get the actual option values.
Running the program shows that we pick up the value
-value for FOO
that we set in the program, but that
+for FOO
that we set in the program, but that
BAR
is empty.
package main
Here’s the actual os.Exec
call. If this call is
+
Here’s the actual syscall.Exec
call. If this call is
successful, the execution of our process will end
here and be replaced by the /bin/ls -a -l -h
process. If there is an error we’ll get a return
diff --git a/public/functions b/public/functions
index dd18487..40508a4 100644
--- a/public/functions
+++ b/public/functions
@@ -40,7 +40,7 @@ functions with a few different examples.
package main
When you have multiple consecutive parameters of +the same type, you may omit the type name for the +like-typed parameters up to the final parameter that +declares the type.
+ +func plusPlus(a, b, c int) int {
+ return a + b + c
+}
+
name(args)
.
res := plus(1, 2)
fmt.Println("1+2 =", res)
+
res = plusPlus(1, 2, 3)
+ fmt.Println("1+2+3 =", res)
}
$ go run functions.go
1+2 = 3
+1+2+3 = 6
package main
Note that you don’t need parentheses around conditions -in Go, but that the brackets are required.
+in Go, but that the braces are required.package main
Call the resulting rand.Source
just like the
+
Call the resulting rand.Rand
just like the
functions on the rand
package.
package main
The also finds the first match but returns the +
This also finds the first match but returns the start and end indexes for the match instead of the matching text.
diff --git a/public/string-formatting b/public/string-formatting index 6522477..c651c39 100644 --- a/public/string-formatting +++ b/public/string-formatting @@ -41,7 +41,7 @@ common string formatting tasks.package main
As with integers as seen earlier, %x
renders
+
As with integers seen earlier, %x
renders
the string in base-16, with two output characters
per byte of input.
package main
Format
and Parse
uses example-based layouts. Usually
+
Format
and Parse
use example-based layouts. Usually
you’ll use a constant from time
for these layouts, but
you can also supply custom layouts. Layouts must use the
reference time Mon Jan 2 15:04:05 MST 2006
to show the