Sign in
go
/
website
/
fa6fe8b9e993020027675e7122d2c6d5b7bf76f5
/
.
/
_content
/
talks
/
2015
/
go-for-java-programmers
/
safe.go
blob: 234b4d22719700cbff442b1df4b30a37d64bef97 [
file
] [
log
] [
blame
]
// +build ignore,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)
}