From 45080c435bcdafbe2a53072c29186fd892021f4f Mon Sep 17 00:00:00 2001 From: oohira Date: Sat, 14 Jan 2017 00:28:38 +0900 Subject: [PATCH 1/5] Add style to 'append' function --- examples/slices/slices.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/slices/slices.go b/examples/slices/slices.go index 1918f98..521d1af 100644 --- a/examples/slices/slices.go +++ b/examples/slices/slices.go @@ -30,7 +30,7 @@ func main() { // arrays. One is the builtin `append`, which // returns a slice containing one or more new values. // Note that we need to accept a return value from - // append as we may get a new slice value. + // `append` as we may get a new slice value. s = append(s, "d") s = append(s, "e", "f") fmt.Println("apd:", s) From 8dcf72d27d66757cc87681ee389569059cd76e73 Mon Sep 17 00:00:00 2001 From: oohira Date: Sat, 14 Jan 2017 00:32:51 +0900 Subject: [PATCH 2/5] Replace `Println` with `fmt.Println` --- examples/maps/maps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/maps/maps.go b/examples/maps/maps.go index 425532e..2ed1363 100644 --- a/examples/maps/maps.go +++ b/examples/maps/maps.go @@ -16,7 +16,7 @@ func main() { m["k1"] = 7 m["k2"] = 13 - // Printing a map with e.g. `Println` will show all of + // Printing a map with e.g. `fmt.Println` will show all of // its key/value pairs. fmt.Println("map:", m) From d4b81ba058abb97e76431538c0aeb929dedaa254 Mon Sep 17 00:00:00 2001 From: oohira Date: Sat, 14 Jan 2017 00:34:14 +0900 Subject: [PATCH 3/5] Replace `ints` with `int`s --- examples/variadic-functions/variadic-functions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/variadic-functions/variadic-functions.go b/examples/variadic-functions/variadic-functions.go index 8277bea..5ee4ef2 100644 --- a/examples/variadic-functions/variadic-functions.go +++ b/examples/variadic-functions/variadic-functions.go @@ -8,7 +8,7 @@ package main import "fmt" // Here's a function that will take an arbitrary number -// of `ints` as arguments. +// of `int`s as arguments. func sum(nums ...int) { fmt.Print(nums, " ") total := 0 From 5f9b7a263d131981fb16c81a4d7910f68f093e1b Mon Sep 17 00:00:00 2001 From: oohira Date: Sat, 14 Jan 2017 00:36:06 +0900 Subject: [PATCH 4/5] Add style to 'nil' and Remove redundant space --- examples/errors/errors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/errors/errors.go b/examples/errors/errors.go index 48ee27e..72a20b0 100644 --- a/examples/errors/errors.go +++ b/examples/errors/errors.go @@ -23,7 +23,7 @@ func f1(arg int) (int, error) { } - // A nil value in the error position indicates that + // A `nil` value in the error position indicates that // there was no error. return arg + 3, nil } @@ -74,7 +74,7 @@ func main() { } // If you want to programmatically use the data in - // a custom error, you'll need to get the error as an + // a custom error, you'll need to get the error as an // instance of the custom error type via type // assertion. _, e := f2(42) From 4797db65928fd64df327f4490920bc131e237aa2 Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Thu, 1 Feb 2018 17:54:35 -0500 Subject: [PATCH 5/5] Rebuild for style fixes --- examples/errors/errors.hash | 4 ++-- examples/maps/maps.hash | 4 ++-- examples/slices/slices.hash | 4 ++-- examples/variadic-functions/variadic-functions.hash | 4 ++-- public/errors | 6 +++--- public/maps | 4 ++-- public/slices | 4 ++-- public/variadic-functions | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/errors/errors.hash b/examples/errors/errors.hash index aceb00c..d0b2112 100644 --- a/examples/errors/errors.hash +++ b/examples/errors/errors.hash @@ -1,2 +1,2 @@ -07cffb3d4e37162ab7e9e0a192561ddc8042b81a -BmDQXkPPTk +210ba0f8196006c0380acaec01655816848ef168 +mP_ZR1qjUvA diff --git a/examples/maps/maps.hash b/examples/maps/maps.hash index c5f8c38..57c1a72 100644 --- a/examples/maps/maps.hash +++ b/examples/maps/maps.hash @@ -1,2 +1,2 @@ -2895d63b87f88ab374256c12dd1539cf7b070b77 -E6cGoiKqka +3e39d07e3f80ecbac558c6fb8baee2a5f914cf97 +U67R66Oab8r diff --git a/examples/slices/slices.hash b/examples/slices/slices.hash index 68bb6a1..8b501cb 100644 --- a/examples/slices/slices.hash +++ b/examples/slices/slices.hash @@ -1,2 +1,2 @@ -d900c3b1cf2bd96591f7ad7ce7fd9e592ec31139 -dPQErsP6Yc +c6fa1627841f199dbf901f88580cb97eb92c5530 +Z3_U32sn8RF diff --git a/examples/variadic-functions/variadic-functions.hash b/examples/variadic-functions/variadic-functions.hash index 95ad82d..3c44a2b 100644 --- a/examples/variadic-functions/variadic-functions.hash +++ b/examples/variadic-functions/variadic-functions.hash @@ -1,2 +1,2 @@ -25bcf8d28adf0587d1959e88f32786d7f21872b2 -wRPLOM1VIH +34ba16069a5d972a837cc5c0172ab30873535220 +7f0JlVhToDD diff --git a/public/errors b/public/errors index ae50908..d402097 100644 --- a/public/errors +++ b/public/errors @@ -46,7 +46,7 @@ non-error tasks.

- +
package main
 
@@ -109,7 +109,7 @@ with the given error message.

-

A nil value in the error position indicates that +

A nil value in the error position indicates that there was no error.

@@ -230,7 +230,7 @@ idiom in Go code.

If you want to programmatically use the data in -a custom error, you’ll need to get the error as an +a custom error, you’ll need to get the error as an instance of the custom error type via type assertion.

diff --git a/public/maps b/public/maps index 114b8d0..2829d28 100644 --- a/public/maps +++ b/public/maps @@ -40,7 +40,7 @@ - +
package main
 
@@ -102,7 +102,7 @@ syntax.

-

Printing a map with e.g. Println will show all of +

Printing a map with e.g. fmt.Println will show all of its key/value pairs.

diff --git a/public/slices b/public/slices index 21a827d..412b741 100644 --- a/public/slices +++ b/public/slices @@ -40,7 +40,7 @@ powerful interface to sequences than arrays.

- +
package main
 
@@ -126,7 +126,7 @@ support several more that make them richer than arrays. One is the builtin append, which returns a slice containing one or more new values. Note that we need to accept a return value from -append as we may get a new slice value.

+append as we may get a new slice value.

diff --git a/public/variadic-functions b/public/variadic-functions index a901b83..49b6a0f 100644 --- a/public/variadic-functions +++ b/public/variadic-functions @@ -42,7 +42,7 @@ function.

- +
package main
 
@@ -64,7 +64,7 @@ function.

Here’s a function that will take an arbitrary number -of ints as arguments.

+of ints as arguments.