Commit 9e329a0d authored by Rob Pike's avatar Rob Pike

effective_go.html: move and rework the blank identifier section

Also rename the relevant examples and make sure the working one compiles.

R=golang-dev, bradfitz, adg, iant, rsc
CC=golang-dev
https://golang.org/cl/7597043
parent 3cdf8bae
This diff is collapsed.
......@@ -5,8 +5,14 @@ package main
import (
"fmt"
"io"
"log"
"os"
)
func main() {
greeting := "hello, world"
fd, err := os.Open("test.go")
if err != nil {
log.Fatal(err)
}
// TODO: use fd.
}
// compile
package main
import (
"fmt"
"io"
"log"
"os"
)
var _ = fmt.Printf // For debugging; delete when done.
var _ io.Reader // For debugging; delete when done.
func main() {
fd, err := os.Open("test.go")
if err != nil {
log.Fatal(err)
}
// TODO: use fd.
_ = fd
}
......@@ -16,6 +16,7 @@ effective_go="
eff_bytesize
eff_qr
eff_sequence
eff_unused2
"
error_handling="
......
// compile
package main
import (
"fmt"
"io"
)
var _ = fmt.Printf
var _ io.Reader
func main() {
greeting := "hello, world"
_ = greeting
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment