Created
March 28, 2025 09:02
-
-
Save dacr/6056b35dc21d99250f742727b58dabe8 to your computer and use it in GitHub Desktop.
go routines / published by https://github.com/dacr/code-examples-manager #3052509b-a36e-42d4-a6f9-6aff6b7d6d6e/fc322bb9972612be3fa40b808783ba4280081bcc
This file contains hidden or 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
/*?sr/bin/true; exec /usr/bin/env nix-shell -p go --run "go run $0" #*/ | |
// summary : go routines | |
// keywords : go, goroutines, @testable | |
// publish : gist | |
// authors : David Crosson | |
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
// id : 3052509b-a36e-42d4-a6f9-6aff6b7d6d6e | |
// created-on : 2025-03-27T14:28:34+01:00 | |
// managed-by : https://github.com/dacr/code-examples-manager | |
// run-with : nix-shell -p go --run "go run $file" | |
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
for i := range 100 { | |
go fmt.Println(i) | |
} | |
time.Sleep(500 * time.Millisecond) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment