Skip to content

Instantly share code, notes, and snippets.

@fasmide
Created November 10, 2016 13:27
Show Gist options
  • Save fasmide/bde3d45d88e134cb261c00c3e29de67e to your computer and use it in GitHub Desktop.
Save fasmide/bde3d45d88e134cb261c00c3e29de67e to your computer and use it in GitHub Desktop.
package main
import "fmt"
var k *string
func main() {
ko := string("Blarp")
k = &ko
go skriver("aaaaaa")
go skriver("bbbbbb")
go skriver("bjarne!")
go destroyer()
for {
if k == nil {
fmt.Println("HAHA!")
}
// fmt.Println(k)
}
}
func skriver(a string) {
for {
if k != nil {
*k = a
} else {
k = &a
}
}
}
func destroyer() {
for {
k = nil
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment