Created
June 24, 2018 16:19
-
-
Save cyantarek/8f2f12a013f199864b64ba879d293cfb 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" | |
"time" | |
) | |
func main() { | |
go countFruit("Apple") | |
go countFruit("Orange") | |
time.Sleep(time.Second * 10) | |
} | |
func countFruit(name string) { | |
for i:= 1; true; i++ { | |
fmt.Println(name) | |
time.Sleep(time.Second * 1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment