From 45080c435bcdafbe2a53072c29186fd892021f4f Mon Sep 17 00:00:00 2001 From: oohira Date: Sat, 14 Jan 2017 00:28:38 +0900 Subject: [PATCH 1/4] 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/4] 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/4] 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/4] 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)