다중 할당에서의 공백 식별자

if _, err := os.Stat(path); os.IsNotExist(err) {
    fmt.Printf("%s does not exist\\n", path)
}
// Bad! This code will crash if path does not exist.
fi, _ := os.Stat(path)
if fi.IsDir() {
    fmt.Printf("%s is a directory\\n", path)
}

미사용 임포트와 변수

package main

import (
    "fmt"
    "io"
    "log"
    "os"
)

func main() {
    fd, err := os.Open("test.go")
    if err != nil {
        log.Fatal(err)
    }
    // TODO: use fd.
}