summaryrefslogtreecommitdiffhomepage
path: root/go.html.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'go.html.markdown')
-rw-r--r--go.html.markdown20
1 files changed, 10 insertions, 10 deletions
diff --git a/go.html.markdown b/go.html.markdown
index fe69ed43..59ba2e4f 100644
--- a/go.html.markdown
+++ b/go.html.markdown
@@ -46,7 +46,7 @@ package main
import (
"fmt" // A package in the Go standard library.
"io/ioutil" // Implements some I/O utility functions.
- "math" // Math library with local alias m.
+ m "math" // Math library with local alias m.
"net/http" // Yes, a web server!
"os" // OS functions like working with the file system
"strconv" // String conversions.
@@ -95,7 +95,7 @@ can include line breaks.` // Same string type.
// Non-ASCII literal. Go source is UTF-8.
g := 'Σ' // rune type, an alias for int32, holds a unicode code point.
- f := 3.14195 // float64, an IEEE-754 64-bit floating point number.
+ f := 3.14159 // float64, an IEEE-754 64-bit floating point number.
c := 3 + 4i // complex128, represented internally with two float64's.
// var syntax with initializers.
@@ -130,7 +130,7 @@ can include line breaks.` // Same string type.
// Because they are dynamic, slices can be appended to on-demand.
// To append elements to a slice, the built-in append() function is used.
// First argument is a slice to which we are appending. Commonly,
- // the array variable is updated in place, as in example below.
+ // the slice variable is updated in place, as in example below.
s := []int{1, 2, 3} // Result is a slice of length 3.
s = append(s, 4, 5, 6) // Added 3 elements. Slice now has length of 6.
fmt.Println(s) // Updated slice is now [1 2 3 4 5 6]
@@ -357,7 +357,7 @@ func learnInterfaces() {
// Functions can have variadic parameters.
func learnVariadicParams(myStrings ...interface{}) {
// Iterate each value of the variadic.
- // The underbar here is ignoring the index argument of the array.
+ // The underscore here is ignoring the index argument of the array.
for _, param := range myStrings {
fmt.Println("param:", param)
}
@@ -456,21 +456,21 @@ func requestServer() {
## Further Reading
-The root of all things Go is the [official Go web site](http://golang.org/).
+The root of all things Go is the [official Go web site](https://go.dev/).
There you can follow the tutorial, play interactively, and read lots.
-Aside from a tour, [the docs](https://golang.org/doc/) contain information on
+Aside from a tour, [the docs](https://go.dev/doc/) contain information on
how to write clean and effective Go code, package and command docs, and release history.
-The [Go language specification](https://golang.org/ref/spec) itself is highly recommended. It's easy to read
+The [Go language specification](https://go.dev/ref/spec) itself is highly recommended. It's easy to read
and amazingly short (as language definitions go these days.)
-You can play around with the code on [Go playground](https://play.golang.org/p/tnWMjr16Mm). Try to change it and run it from your browser! Note that you can use [https://play.golang.org](https://play.golang.org) as a [REPL](https://en.wikipedia.org/wiki/Read-eval-print_loop) to test things and code in your browser, without even installing Go.
+You can play around with the code on [Go playground](https://go.dev/play/p/tnWMjr16Mm). Try to change it and run it from your browser! Note that you can use [https://go.dev/play/](https://go.dev/play/) as a [REPL](https://en.wikipedia.org/wiki/Read-eval-print_loop) to test things and code in your browser, without even installing Go.
On the reading list for students of Go is the [source code to the standard
-library](http://golang.org/src/pkg/). Comprehensively documented, it
+library](https://go.dev/src/). Comprehensively documented, it
demonstrates the best of readable and understandable Go, Go style, and Go
idioms. Or you can click on a function name in [the
-documentation](http://golang.org/pkg/) and the source code comes up!
+documentation](https://go.dev/pkg/) and the source code comes up!
Another great resource to learn Go is [Go by example](https://gobyexample.com/).