Skip to content

Instantly share code, notes, and snippets.

@fasmide
Created Nov 10, 2016
Embed
What would you like to do?
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