Sign in
go
/
talks
/
b88df1b0d81c57686e93202503e1d9236efb8bd2
/
.
/
2015
/
go-for-java-programmers
/
safe.go
blob: 68e11367908f912c7a1aa55e1b4a3b6a9e8ddc53 [
file
] [
log
] [
blame
]
// +build OMIT
package main
import "fmt"
func newInt(v int) *int {
var n = v
return &n
// HL
}
func inc(p *int) {
*p++
// try removing * // HL
}
func main() {
p := newInt(3)
inc(p)
fmt.Println(p, "points to", *p)
}