-
-
Notifications
You must be signed in to change notification settings - Fork 88
Closed
Labels
awaiting-feedbackRequires feedback from one or other usersRequires feedback from one or other usersbugSomething isn't workingSomething isn't workinginfra
Description
Describe the bug
When attempting to execute the code below, the Playground returned a 403
error then shown in the Output panel.
The funny part is that it seems a simple comment in the snippet breaks the playground, and attempting to click on Share
also fails.
To Reproduce
Steps to reproduce the behavior:
- Go to the playground and enter this snippet
package main
import (
"fmt"
"sync"
"time"
)
func main() {
doneChan := make(chan struct{})
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
time.Sleep(2 * time.Second)
fmt.Println("Task from WaitGroup done")
}()
go func() {
time.Sleep(1 * time.Second)
fmt.Println("Task from channel done")
doneChan <- struct{}{}
}()
// This simple comment breaks the playground (remove it and it will work)
wgDoneChan := make(chan struct{})
go func() {
wg.Wait()
close(wgDoneChan)
}()
select {
case <-doneChan:
fmt.Println("Received done signal from channel")
case <-wgDoneChan:
fmt.Println("All WaitGroup tasks done")
}
}
- Click on 'Run'
- Then you will get an
Error 403 ...
in the Output panel.
Expected behavior
Code executed without backend issues.
Screenshots
Desktop (please complete the following information):
- OS: macos
- Browser Chrome 138.0.7204.101
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
awaiting-feedbackRequires feedback from one or other usersRequires feedback from one or other usersbugSomething isn't workingSomething isn't workinginfra