Created
February 13, 2021 02:31
-
-
Save shazadbrohi/1a6a3881f4ff5063da9d3627dc945ffb to your computer and use it in GitHub Desktop.
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
func worker(pid int, wg *sync.WaitGroup, file *os.File){ | |
defer wg.Done() | |
fmt.Printf("Worker Process %d writing to file...\n", pid) | |
content := fmt.Sprintf("Worker %d wrote to the file\n", pid) | |
file.WriteString(content) | |
file.Sync() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment