Skip to content

Instantly share code, notes, and snippets.

@iand
iand / main.go
Last active December 7, 2017 17:14
How I start writing every command line tool in Go
package main
import (
"flag"
"fmt"
"os"
)
func main() {
flag.Parse()
@iand
iand / bounds check results
Created September 25, 2018 13:33
Bounds check elimination in Go
14:24 $ go build -gcflags="-d=ssa/check_bce/debug=1"
# _/home/iand/wip/bounds
./bounds.go:17:12: Found IsSliceInBounds
./bounds.go:18:10: Found IsInBounds
./bounds.go:19:10: Found IsInBounds
./bounds.go:20:10: Found IsInBounds
./bounds.go:21:10: Found IsInBounds
./bounds.go:23:12: Found IsSliceInBounds
./bounds.go:24:11: Found IsInBounds
./bounds.go:25:11: Found IsInBounds