From 2d9b20457174f18188dc52693064689fa2bef82b Mon Sep 17 00:00:00 2001
From: Mark McGranaghan
Date: Fri, 31 May 2019 12:45:42 -0700
Subject: [PATCH] Use "conversion" instead of "cast", per spec
Closes #200
---
examples/base64-encoding/base64-encoding.go | 2 +-
examples/base64-encoding/base64-encoding.hash | 4 ++--
examples/constants/constants.go | 2 +-
examples/constants/constants.hash | 4 ++--
examples/json/json.go | 6 +++---
examples/json/json.hash | 4 ++--
examples/sorting-by-functions/sorting-by-functions.go | 4 ++--
examples/sorting-by-functions/sorting-by-functions.hash | 4 ++--
public/base64-encoding | 4 ++--
public/constants | 4 ++--
public/json | 8 ++++----
public/sorting-by-functions | 6 +++---
12 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/examples/base64-encoding/base64-encoding.go b/examples/base64-encoding/base64-encoding.go
index d37167f..d428ae5 100644
--- a/examples/base64-encoding/base64-encoding.go
+++ b/examples/base64-encoding/base64-encoding.go
@@ -17,7 +17,7 @@ func main() {
// Go supports both standard and URL-compatible
// base64. Here's how to encode using the standard
// encoder. The encoder requires a `[]byte` so we
- // cast our `string` to that type.
+ // convert our `string` to that type.
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
fmt.Println(sEnc)
diff --git a/examples/base64-encoding/base64-encoding.hash b/examples/base64-encoding/base64-encoding.hash
index 25e1653..1cb409a 100644
--- a/examples/base64-encoding/base64-encoding.hash
+++ b/examples/base64-encoding/base64-encoding.hash
@@ -1,2 +1,2 @@
-e57f5be3a796261fb4a55cdb0580a254e14b4930
-t6rFm2x4Yr
+c20da14820b656c867790f2e99bc37140babca8c
+y_QTcqdkvZh
diff --git a/examples/constants/constants.go b/examples/constants/constants.go
index 5ed88a4..ed4b56a 100644
--- a/examples/constants/constants.go
+++ b/examples/constants/constants.go
@@ -22,7 +22,7 @@ func main() {
fmt.Println(d)
// A numeric constant has no type until it's given
- // one, such as by an explicit cast.
+ // one, such as by an explicit conversion.
fmt.Println(int64(d))
// A number can be given a type by using it in a
diff --git a/examples/constants/constants.hash b/examples/constants/constants.hash
index b5ab256..1e282aa 100644
--- a/examples/constants/constants.hash
+++ b/examples/constants/constants.hash
@@ -1,2 +1,2 @@
-3de4f16f1ed032378268411b2173b95e8000305d
-T5sj0eINnp
+2f2ec3a5ff4eef280199da1908eed261346fb40e
+VhP0f8moZd3
diff --git a/examples/json/json.go b/examples/json/json.go
index 6a1f56d..ff777a1 100644
--- a/examples/json/json.go
+++ b/examples/json/json.go
@@ -85,14 +85,14 @@ func main() {
fmt.Println(dat)
// In order to use the values in the decoded map,
- // we'll need to cast them to their appropriate type.
- // For example here we cast the value in `num` to
+ // we'll need to convert them to their appropriate type.
+ // For example here we convert the value in `num` to
// the expected `float64` type.
num := dat["num"].(float64)
fmt.Println(num)
// Accessing nested data requires a series of
- // casts.
+ // conversions.
strs := dat["strs"].([]interface{})
str1 := strs[0].(string)
fmt.Println(str1)
diff --git a/examples/json/json.hash b/examples/json/json.hash
index c9282a5..3acb1f6 100644
--- a/examples/json/json.hash
+++ b/examples/json/json.hash
@@ -1,2 +1,2 @@
-43e8d66fb862ea224994ca766e5689a96016f7ca
-UGeNKd-cw34
+d4dc2281f64061f077d8f1e9687538f41a339b25
+xC6SHbzGBZC
diff --git a/examples/sorting-by-functions/sorting-by-functions.go b/examples/sorting-by-functions/sorting-by-functions.go
index 9ea8c05..e01bdcc 100644
--- a/examples/sorting-by-functions/sorting-by-functions.go
+++ b/examples/sorting-by-functions/sorting-by-functions.go
@@ -33,8 +33,8 @@ func (s byLength) Less(i, j int) bool {
}
// With all of this in place, we can now implement our
-// custom sort by casting the original `fruits` slice to
-// `byLength`, and then use `sort.Sort` on that typed
+// custom sort by converting the original `fruits` slice
+// to `byLength`, and then use `sort.Sort` on that typed
// slice.
func main() {
fruits := []string{"peach", "banana", "kiwi"}
diff --git a/examples/sorting-by-functions/sorting-by-functions.hash b/examples/sorting-by-functions/sorting-by-functions.hash
index fbf46ed..776dde8 100644
--- a/examples/sorting-by-functions/sorting-by-functions.hash
+++ b/examples/sorting-by-functions/sorting-by-functions.hash
@@ -1,2 +1,2 @@
-a5bcb1620c62f89f8253d7d2a2580b5ae48771b6
-4b7_qiGp33y
+6a04058b564d5741815e523f97f240ee6563cb15
+y3kuCwIFRYK
diff --git a/public/base64-encoding b/public/base64-encoding
index 5a82f4c..f067bee 100644
--- a/public/base64-encoding
+++ b/public/base64-encoding
@@ -28,7 +28,7 @@ encoding/decoding.
-
+
@@ -81,7 +81,7 @@ save us some space below.
Go supports both standard and URL-compatible
base64. Here’s how to encode using the standard
encoder. The encoder requires a []byte so we
-cast our string to that type.
+convert our string to that type.
|
diff --git a/public/constants b/public/constants
index a53a96f..bdf3a2f 100644
--- a/public/constants
+++ b/public/constants
@@ -28,7 +28,7 @@ and numeric values.
|
-
+
@@ -106,7 +106,7 @@ arbitrary precision.
|
A numeric constant has no type until it’s given
-one, such as by an explicit cast.
+one, such as by an explicit conversion.
|
diff --git a/public/json b/public/json
index fe40d60..61fe8bc 100644
--- a/public/json
+++ b/public/json
@@ -29,7 +29,7 @@ data types.
|
-
+
@@ -259,8 +259,8 @@ associated errors.
|
In order to use the values in the decoded map,
-we’ll need to cast them to their appropriate type.
-For example here we cast the value in num to
+we’ll need to convert them to their appropriate type.
+For example here we convert the value in num to
the expected float64 type.
|
@@ -276,7 +276,7 @@ the expected float64
type.
Accessing nested data requires a series of
-casts.
+conversions.
|
diff --git a/public/sorting-by-functions b/public/sorting-by-functions
index ca48e6f..5daf9d4 100644
--- a/public/sorting-by-functions
+++ b/public/sorting-by-functions
@@ -31,7 +31,7 @@ in Go.
|
-
+
@@ -97,8 +97,8 @@ we use len(s[i]) and len(s[j]) here.
|
With all of this in place, we can now implement our
-custom sort by casting the original fruits slice to
-byLength , and then use sort.Sort on that typed
+custom sort by converting the original fruits slice
+to byLength , and then use sort.Sort on that typed
slice.
|