summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <sokolyuk@gmail.com>2022-11-22 14:06:43 +0100
committerDimitri Sokolyuk <sokolyuk@gmail.com>2022-11-22 14:06:43 +0100
commit62966e2253ff5a045852e46b443c5c2a9e7f9f63 (patch)
tree43f8ae603e8aa5110ba0c6f5302c60f056cf7cbf
parente27f94c1228ab6991bf3a6ca2475cdaf1ee77dd2 (diff)
Fix "did you mean fmt.Sprint(x)?"
-rw-r--r--go.mod2
-rw-r--r--go/luhn/luhn.go2
-rw-r--r--go/robot-name/robot_name.go4
3 files changed, 4 insertions, 4 deletions
diff --git a/go.mod b/go.mod
index 3050ff5..0f0b3a5 100644
--- a/go.mod
+++ b/go.mod
@@ -1,3 +1,3 @@
module dim13.org/exercism
-go 1.13
+go 1.19
diff --git a/go/luhn/luhn.go b/go/luhn/luhn.go
index c11cde3..5da01f7 100644
--- a/go/luhn/luhn.go
+++ b/go/luhn/luhn.go
@@ -38,5 +38,5 @@ func Valid(s string) bool {
func AddCheck(s string) string {
sum := chksum(normalize(s + "9"))
n := 9 - sum%10
- return s + string('0'+n)
+ return s + string('0'+rune(n))
}
diff --git a/go/robot-name/robot_name.go b/go/robot-name/robot_name.go
index 6230e1c..2cf4a60 100644
--- a/go/robot-name/robot_name.go
+++ b/go/robot-name/robot_name.go
@@ -13,8 +13,8 @@ type Robot struct {
name string
}
-func randLetter() string { return string('A' + rand.Intn(26)) }
-func randNumber() string { return string('0' + rand.Intn(10)) }
+func randLetter() string { return string('A' + rune(rand.Intn(26))) }
+func randNumber() string { return string('0' + rune(rand.Intn(10))) }
func newName() string {
return randLetter() + randLetter() +