Merge remote-tracking branch 'oohira/fix-word-style' into fix-word-style
This commit is contained in:
commit
592243aa85
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user