diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index e79402c..ae89841 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
- go-version: [1.18.0]
+ go-version: [1.18.3]
runs-on: ${{ matrix.os }}
steps:
diff --git a/README.md b/README.md
index 538bfd5..1bf00e9 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ $ tools/upload
This work is copyright Mark McGranaghan and licensed under a
[Creative Commons Attribution 3.0 Unported License](http://creativecommons.org/licenses/by/3.0/).
-The Go Gopher is copyright [Renée French](http://reneefrench.blogspot.com/) and licensed under a
+The Go Gopher is copyright [Renée French](https://reneefrench.blogspot.com/) and licensed under a
[Creative Commons Attribution 3.0 Unported License](http://creativecommons.org/licenses/by/3.0/).
@@ -66,12 +66,12 @@ Contributor translations of the Go by Example site are available in:
* [Chinese](https://gobyexample-cn.github.io/) by [gobyexample-cn](https://github.com/gobyexample-cn)
* [Czech](http://gobyexamples.sweb.cz/) by [martinkunc](https://github.com/martinkunc/gobyexample-cz)
* [French](http://le-go-par-l-exemple.keiruaprod.fr) by [keirua](https://github.com/keirua/gobyexample)
-* [Italian](http://gobyexample.it) by the [Go Italian community](https://github.com/golangit/gobyexample-it)
+* [Italian](https://gobyexample.it) by the [Go Italian community](https://github.com/golangit/gobyexample-it)
* [Japanese](http://spinute.org/go-by-example) by [spinute](https://github.com/spinute)
* [Korean](https://mingrammer.com/gobyexample/) by [mingrammer](https://github.com/mingrammer)
* [Russian](https://gobyexample.com.ru/) by [badkaktus](https://github.com/badkaktus)
* [Spanish](http://goconejemplos.com) by the [Go Mexico community](https://github.com/dabit/gobyexample)
-* [Ukrainian](http://butuzov.github.io/gobyexample/) by [butuzov](https://github.com/butuzov/gobyexample)
+* [Ukrainian](https://butuzov.github.io/gobyexample/) by [butuzov](https://github.com/butuzov/gobyexample)
### Thanks
diff --git a/examples/base64-encoding/base64-encoding.go b/examples/base64-encoding/base64-encoding.go
index 09e94fd..d5a0b9b 100644
--- a/examples/base64-encoding/base64-encoding.go
+++ b/examples/base64-encoding/base64-encoding.go
@@ -1,5 +1,5 @@
// Go provides built-in support for [base64
-// encoding/decoding](http://en.wikipedia.org/wiki/Base64).
+// encoding/decoding](https://en.wikipedia.org/wiki/Base64).
package main
diff --git a/examples/base64-encoding/base64-encoding.hash b/examples/base64-encoding/base64-encoding.hash
index 09e2b2a..e2b8deb 100644
--- a/examples/base64-encoding/base64-encoding.hash
+++ b/examples/base64-encoding/base64-encoding.hash
@@ -1,2 +1,2 @@
-cd00d89ad0a31e48d6a2e2adc2e8d65b0f70dc73
-S7ff3UgzNlG
+47f0317643bc5107af6fae64cb0fdad1260ead37
+yztzkirFEvv
diff --git a/examples/closures/closures.go b/examples/closures/closures.go
index 90dc2eb..27def72 100644
--- a/examples/closures/closures.go
+++ b/examples/closures/closures.go
@@ -1,5 +1,5 @@
-// Go supports [_anonymous functions_](http://en.wikipedia.org/wiki/Anonymous_function),
-// which can form closures.
+// Go supports [_anonymous functions_](https://en.wikipedia.org/wiki/Anonymous_function),
+// which can form closures.
// Anonymous functions are useful when you want to define
// a function inline without having to name it.
diff --git a/examples/closures/closures.hash b/examples/closures/closures.hash
index df8a22b..7dafe7d 100644
--- a/examples/closures/closures.hash
+++ b/examples/closures/closures.hash
@@ -1,2 +1,2 @@
-6713bdbb6de0d7d484422517dd77316c8b9f0a7a
-66Lgw9iIIch
+6514e124c8127250a2eecfadc9708181e51f9603
+NpgpzS8ZG8y
diff --git a/examples/command-line-arguments/command-line-arguments.go b/examples/command-line-arguments/command-line-arguments.go
index 1104113..a3fb3e6 100644
--- a/examples/command-line-arguments/command-line-arguments.go
+++ b/examples/command-line-arguments/command-line-arguments.go
@@ -1,4 +1,4 @@
-// [_Command-line arguments_](http://en.wikipedia.org/wiki/Command-line_interface#Arguments)
+// [_Command-line arguments_](https://en.wikipedia.org/wiki/Command-line_interface#Arguments)
// are a common way to parameterize execution of programs.
// For example, `go run hello.go` uses `run` and
// `hello.go` arguments to the `go` program.
diff --git a/examples/command-line-arguments/command-line-arguments.hash b/examples/command-line-arguments/command-line-arguments.hash
index 6587429..c099ea1 100644
--- a/examples/command-line-arguments/command-line-arguments.hash
+++ b/examples/command-line-arguments/command-line-arguments.hash
@@ -1,2 +1,2 @@
-d60d1c9cb5dbbb748cf3b692334076951cea7d59
-oSxtj7v_v1K
+ad871e829d1457d97d0f1c1af77e39f6942ac5a5
+UYCEvh9d2Zb
diff --git a/examples/command-line-flags/command-line-flags.go b/examples/command-line-flags/command-line-flags.go
index 886de07..16412cd 100644
--- a/examples/command-line-flags/command-line-flags.go
+++ b/examples/command-line-flags/command-line-flags.go
@@ -1,4 +1,4 @@
-// [_Command-line flags_](http://en.wikipedia.org/wiki/Command-line_interface#Command-line_option)
+// [_Command-line flags_](https://en.wikipedia.org/wiki/Command-line_interface#Command-line_option)
// are a common way to specify options for command-line
// programs. For example, in `wc -l` the `-l` is a
// command-line flag.
diff --git a/examples/command-line-flags/command-line-flags.hash b/examples/command-line-flags/command-line-flags.hash
index 5c128da..4b5c049 100644
--- a/examples/command-line-flags/command-line-flags.hash
+++ b/examples/command-line-flags/command-line-flags.hash
@@ -1,2 +1,2 @@
-08e716a5ee3b5f74ef826d7b5ce157cb3b44c4f7
--zzqphwtdJq
+9cca50e58f488570cc8e92dde37582ea5ee04bf3
+IUPZlYSigc3
diff --git a/examples/environment-variables/environment-variables.go b/examples/environment-variables/environment-variables.go
index e3e42a5..f1d3dc1 100644
--- a/examples/environment-variables/environment-variables.go
+++ b/examples/environment-variables/environment-variables.go
@@ -1,6 +1,6 @@
-// [Environment variables](http://en.wikipedia.org/wiki/Environment_variable)
+// [Environment variables](https://en.wikipedia.org/wiki/Environment_variable)
// are a universal mechanism for [conveying configuration
-// information to Unix programs](http://www.12factor.net/config).
+// information to Unix programs](https://www.12factor.net/config).
// Let's look at how to set, get, and list environment variables.
package main
diff --git a/examples/environment-variables/environment-variables.hash b/examples/environment-variables/environment-variables.hash
index bf64045..02c7a25 100644
--- a/examples/environment-variables/environment-variables.hash
+++ b/examples/environment-variables/environment-variables.hash
@@ -1,2 +1,2 @@
-bee983e7820d64dec5331dc706c08f6135b5c632
-KuD8tDyB4lQ
+f480d3803659977183a4bc5c14da26c80b1d31fe
+2jmwXM264NC
diff --git a/examples/epoch/epoch.go b/examples/epoch/epoch.go
index a48ece9..f77ab30 100644
--- a/examples/epoch/epoch.go
+++ b/examples/epoch/epoch.go
@@ -1,6 +1,6 @@
// A common requirement in programs is getting the number
// of seconds, milliseconds, or nanoseconds since the
-// [Unix epoch](http://en.wikipedia.org/wiki/Unix_time).
+// [Unix epoch](https://en.wikipedia.org/wiki/Unix_time).
// Here's how to do it in Go.
package main
diff --git a/examples/epoch/epoch.hash b/examples/epoch/epoch.hash
index 7248790..579635a 100644
--- a/examples/epoch/epoch.hash
+++ b/examples/epoch/epoch.hash
@@ -1,2 +1,2 @@
-54e66c2e84334f2adbf87aaeb62065111c5644ea
-iG_EcjJp4ss
+a67ae165a1f00c205a344327d9d638f4eb931b5c
+lRmD1EWHHPz
diff --git a/examples/errors/errors.sh b/examples/errors/errors.sh
index 068d606..54315ae 100644
--- a/examples/errors/errors.sh
+++ b/examples/errors/errors.sh
@@ -6,5 +6,5 @@ f2 failed: 42 - can't work with it
42
can't work with it
-# See this [great post](http://blog.golang.org/2011/07/error-handling-and-go.html)
+# See this [great post](https://go.dev/blog/error-handling-and-go)
# on the Go blog for more on error handling.
diff --git a/examples/execing-processes/execing-processes.go b/examples/execing-processes/execing-processes.go
index 04f5816..7ac8300 100644
--- a/examples/execing-processes/execing-processes.go
+++ b/examples/execing-processes/execing-processes.go
@@ -5,7 +5,7 @@
// completely replace the current Go process with another
// (perhaps non-Go) one. To do this we'll use Go's
// implementation of the classic
-// exec
+// exec
// function.
package main
diff --git a/examples/execing-processes/execing-processes.hash b/examples/execing-processes/execing-processes.hash
index 8ba5637..90bd325 100644
--- a/examples/execing-processes/execing-processes.hash
+++ b/examples/execing-processes/execing-processes.hash
@@ -1,2 +1,2 @@
-18867a0e743aaadb2aba0a0c7b1ca8098a1aa95c
-nI-HMuCI2lG
+568ae983493addff02d2ce8df57f41daf537f077
+s9qg7olf1dM
diff --git a/examples/http-clients/http-clients.go b/examples/http-clients/http-clients.go
index 7cd71ef..57b22f2 100644
--- a/examples/http-clients/http-clients.go
+++ b/examples/http-clients/http-clients.go
@@ -17,7 +17,7 @@ func main() {
// object and calling its `Get` method; it uses the
// `http.DefaultClient` object which has useful default
// settings.
- resp, err := http.Get("http://gobyexample.com")
+ resp, err := http.Get("https://gobyexample.com")
if err != nil {
panic(err)
}
diff --git a/examples/http-clients/http-clients.hash b/examples/http-clients/http-clients.hash
index b36a4b2..8193364 100644
--- a/examples/http-clients/http-clients.hash
+++ b/examples/http-clients/http-clients.hash
@@ -1,2 +1,2 @@
-fbc80f8cfcd34e9daa3c52c23f6720f6ef7019dc
-kHCcVLoz7nd
+1497e193431e4740f593039f613773daaf97772e
+vFW_el7oHMk
diff --git a/examples/if-else/if-else.sh b/examples/if-else/if-else.sh
index 13c363f..52ccc11 100644
--- a/examples/if-else/if-else.sh
+++ b/examples/if-else/if-else.sh
@@ -3,6 +3,6 @@ $ go run if-else.go
8 is divisible by 4
9 has 1 digit
-# There is no [ternary if](http://en.wikipedia.org/wiki/%3F:)
+# There is no [ternary if](https://en.wikipedia.org/wiki/%3F:)
# in Go, so you'll need to use a full `if` statement even
# for basic conditions.
diff --git a/examples/interfaces/interfaces.sh b/examples/interfaces/interfaces.sh
index f800e3a..b711476 100644
--- a/examples/interfaces/interfaces.sh
+++ b/examples/interfaces/interfaces.sh
@@ -7,4 +7,4 @@ $ go run interfaces.go
31.41592653589793
# To learn more about Go's interfaces, check out this
-# [great blog post](http://jordanorelli.tumblr.com/post/32665860244/how-to-use-interfaces-in-go).
+# [great blog post](https://jordanorelli.tumblr.com/post/32665860244/how-to-use-interfaces-in-go).
diff --git a/examples/json/json.sh b/examples/json/json.sh
index e9d0c9f..a21ef9d 100644
--- a/examples/json/json.sh
+++ b/examples/json/json.sh
@@ -16,6 +16,6 @@ apple
# We've covered the basic of JSON in Go here, but check
-# out the [JSON and Go](http://blog.golang.org/2011/01/json-and-go.html)
-# blog post and [JSON package docs](http://golang.org/pkg/encoding/json/)
+# out the [JSON and Go](https://go.dev/blog/json)
+# blog post and [JSON package docs](https://pkg.go.dev/encoding/json)
# for more.
diff --git a/examples/maps/maps.go b/examples/maps/maps.go
index 3346270..8a40d35 100644
--- a/examples/maps/maps.go
+++ b/examples/maps/maps.go
@@ -1,4 +1,4 @@
-// _Maps_ are Go's built-in [associative data type](http://en.wikipedia.org/wiki/Associative_array)
+// _Maps_ are Go's built-in [associative data type](https://en.wikipedia.org/wiki/Associative_array)
// (sometimes called _hashes_ or _dicts_ in other languages).
package main
diff --git a/examples/maps/maps.hash b/examples/maps/maps.hash
index 79caf58..2c0cd81 100644
--- a/examples/maps/maps.hash
+++ b/examples/maps/maps.hash
@@ -1,2 +1,2 @@
-9e0e4535c99668b460c7175f8ff2edc2ccf58bec
-agK2Ro2i-Lu
+22d147fe9402f9ff210f12b9810811c07f4d64ca
+ulCzODwCde_0
diff --git a/examples/mutexes/mutexes.go b/examples/mutexes/mutexes.go
index 448eb6c..9569ba5 100644
--- a/examples/mutexes/mutexes.go
+++ b/examples/mutexes/mutexes.go
@@ -1,6 +1,6 @@
// In the previous example we saw how to manage simple
// counter state using [atomic operations](atomic-counters).
-// For more complex state we can use a [_mutex_](http://en.wikipedia.org/wiki/Mutual_exclusion)
+// For more complex state we can use a [_mutex_](https://en.wikipedia.org/wiki/Mutual_exclusion)
// to safely access data across multiple goroutines.
package main
diff --git a/examples/mutexes/mutexes.hash b/examples/mutexes/mutexes.hash
index 974d727..8c57af1 100644
--- a/examples/mutexes/mutexes.hash
+++ b/examples/mutexes/mutexes.hash
@@ -1,2 +1,2 @@
-3688453f408d8c7cc6db91ab7fd5e0ac06ade7ea
-tDqeib2-yZA
+a437476f37f1f797e1bab491b3f2ac9b386f6700
+Kr_cdza5vyz
diff --git a/examples/pointers/pointers.go b/examples/pointers/pointers.go
index 5574997..1a24906 100644
--- a/examples/pointers/pointers.go
+++ b/examples/pointers/pointers.go
@@ -1,4 +1,4 @@
-// Go supports pointers,
+// Go supports pointers,
// allowing you to pass references to values and records
// within your program.
diff --git a/examples/pointers/pointers.hash b/examples/pointers/pointers.hash
index 455774f..b67064b 100644
--- a/examples/pointers/pointers.hash
+++ b/examples/pointers/pointers.hash
@@ -1,2 +1,2 @@
-c727916063ddc3e99199cd24bfbde37ff301c0b4
-oimmXypnAcs
+7f9855cfb983efc07415117e2be734f55a6bb64b
+OlWCLpxAyBz
diff --git a/examples/random-numbers/random-numbers.go b/examples/random-numbers/random-numbers.go
index ebb6a8c..3bd5d54 100644
--- a/examples/random-numbers/random-numbers.go
+++ b/examples/random-numbers/random-numbers.go
@@ -1,5 +1,5 @@
// Go's `math/rand` package provides
-// [pseudorandom number](http://en.wikipedia.org/wiki/Pseudorandom_number_generator)
+// [pseudorandom number](https://en.wikipedia.org/wiki/Pseudorandom_number_generator)
// generation.
package main
diff --git a/examples/random-numbers/random-numbers.hash b/examples/random-numbers/random-numbers.hash
index 907e93b..338e522 100644
--- a/examples/random-numbers/random-numbers.hash
+++ b/examples/random-numbers/random-numbers.hash
@@ -1,2 +1,2 @@
-102041ca421268afbd4b4e7687386bb65a8c7965
-PGklfJzErTN
+f0f88939692a32975d902c94066537a6ba5ab96f
+RaoKyUd9tgC
diff --git a/examples/random-numbers/random-numbers.sh b/examples/random-numbers/random-numbers.sh
index 67c37a8..3cd78b4 100644
--- a/examples/random-numbers/random-numbers.sh
+++ b/examples/random-numbers/random-numbers.sh
@@ -7,6 +7,6 @@ $ go run random-numbers.go
5,87
-# See the [`math/rand`](http://golang.org/pkg/math/rand/)
+# See the [`math/rand`](https://pkg.go.dev/math/rand)
# package docs for references on other random quantities
# that Go can provide.
diff --git a/examples/rate-limiting/rate-limiting.go b/examples/rate-limiting/rate-limiting.go
index d890e7f..f1e84c1 100644
--- a/examples/rate-limiting/rate-limiting.go
+++ b/examples/rate-limiting/rate-limiting.go
@@ -1,4 +1,4 @@
-// [_Rate limiting_](http://en.wikipedia.org/wiki/Rate_limiting)
+// [_Rate limiting_](https://en.wikipedia.org/wiki/Rate_limiting)
// is an important mechanism for controlling resource
// utilization and maintaining quality of service. Go
// elegantly supports rate limiting with goroutines,
diff --git a/examples/rate-limiting/rate-limiting.hash b/examples/rate-limiting/rate-limiting.hash
index adb0bfc..3b65732 100644
--- a/examples/rate-limiting/rate-limiting.hash
+++ b/examples/rate-limiting/rate-limiting.hash
@@ -1,2 +1,2 @@
-c7063265708287744ea172ed9ed1390043140718
-GXjXHfnKFXg
+4f327f5bd5ac199ae5590652563ea6ca4ce7eff5
+lqf7pC2FUeT
diff --git a/examples/recursion/recursion.go b/examples/recursion/recursion.go
index f0ce4e1..b85deb8 100644
--- a/examples/recursion/recursion.go
+++ b/examples/recursion/recursion.go
@@ -1,5 +1,5 @@
// Go supports
-// recursive functions.
+// recursive functions.
// Here's a classic example.
package main
diff --git a/examples/recursion/recursion.hash b/examples/recursion/recursion.hash
index 0260100..7237c6a 100644
--- a/examples/recursion/recursion.hash
+++ b/examples/recursion/recursion.hash
@@ -1,2 +1,2 @@
-9ac9b5af828c33eb20dd322fd1a991334242c4b3
-7hD-3-bIuSp
+cdbd1a6957b3e2d7d9baa9efe4581ba4f8f3e753
+MBTKk9VpAiK
diff --git a/examples/regular-expressions/regular-expressions.go b/examples/regular-expressions/regular-expressions.go
index e10e934..aa7bf75 100644
--- a/examples/regular-expressions/regular-expressions.go
+++ b/examples/regular-expressions/regular-expressions.go
@@ -1,4 +1,4 @@
-// Go offers built-in support for [regular expressions](http://en.wikipedia.org/wiki/Regular_expression).
+// Go offers built-in support for [regular expressions](https://en.wikipedia.org/wiki/Regular_expression).
// Here are some examples of common regexp-related tasks
// in Go.
diff --git a/examples/regular-expressions/regular-expressions.hash b/examples/regular-expressions/regular-expressions.hash
index 63ee8ef..8650e3b 100644
--- a/examples/regular-expressions/regular-expressions.hash
+++ b/examples/regular-expressions/regular-expressions.hash
@@ -1,2 +1,2 @@
-5c3bcf9f8c61fc074143f766c4517e445a6d9b0f
-htCqJrLdh9Q
+7fd60a9497546cb5c84242276ed79aecbde7e950
+fI2YIfYsCaL
diff --git a/examples/regular-expressions/regular-expressions.sh b/examples/regular-expressions/regular-expressions.sh
index ec4f201..afdab0d 100644
--- a/examples/regular-expressions/regular-expressions.sh
+++ b/examples/regular-expressions/regular-expressions.sh
@@ -14,4 +14,4 @@ a
package main
package main
Go provides built-in support for base64
+ Go provides built-in support for base64
encoding/decoding.
package main
package main
package main
package main
package main
package main
Go supports anonymous functions, -which can form closures. +
Go supports anonymous functions, +which can form closures. Anonymous functions are useful when you want to define a function inline without having to name it.
@@ -44,7 +44,7 @@ a function inline without having to name it.package main
Command-line arguments
are a common way to parameterize execution of programs.
For example, go run hello.go
uses run
and
hello.go
arguments to the go
program.
go run hello.go
uses run
and
package main
Command-line flags
are a common way to specify options for command-line
programs. For example, in wc -l
the -l
is a
command-line flag.
package main
package main
package main
package maindiff --git a/public/defer b/public/defer index 2ba790b..2e48c9e 100644 --- a/public/defer +++ b/public/defer @@ -44,7 +44,7 @@ purposes of cleanup.
defer
is often used where e.g.
package main
package main
package maindiff --git a/public/environment-variables b/public/environment-variables index a15776f..fb6a4a1 100644 --- a/public/environment-variables +++ b/public/environment-variables @@ -27,8 +27,8 @@
Environment variables
-are a universal mechanism for conveying configuration
+ Environment variables
+are a universal mechanism for conveying configuration
information to Unix programs.
Let’s look at how to set, get, and list environment variables.
package main
A common requirement in programs is getting the number of seconds, milliseconds, or nanoseconds since the -Unix epoch. +Unix epoch. Here’s how to do it in Go.
package main
package main
See this great post +
See this great post on the Go blog for more on error handling.
exec
+exec
function.
@@ -49,7 +49,7 @@ function.
package main
package main
dir/file
on Linux vs.
package maindiff --git a/public/for b/public/for index 903caba..e5b9674 100644 --- a/public/for +++ b/public/for @@ -42,7 +42,7 @@ some basic types of
for
loops.
package main
package main
package main
package main
package maindiff --git a/public/http-clients b/public/http-clients index 1d16148..596bba3 100644 --- a/public/http-clients +++ b/public/http-clients @@ -34,7 +34,7 @@ HTTP requests.
package main@@ -79,7 +79,7 @@ settings.
- resp, err := http.Get("http://gobyexample.com") + resp, err := http.Get("https://gobyexample.com") if err != nil { panic(err) } @@ -166,7 +166,7 @@ settings.