Created
November 10, 2016 13:27
-
-
Save fasmide/bde3d45d88e134cb261c00c3e29de67e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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