Skip to content

Instantly share code, notes, and snippets.

View aligoren's full-sized avatar
😥
130K

Ali GÖREN aligoren

😥
130K
View GitHub Profile
package main
import (
"fmt"
"sync"
"time"
)
type BirOrnek struct {
sync.Mutex
fatal error: all goroutines are asleep - deadlock!
goroutine 1 [chan send]:
main.main()
H:/GolandProjects/concurrency_samples/main.go:6 +0x31
exit status 2
package main
func main() {
numbers := make(chan int)
numbers <- 4
}
package main
import (
"fmt"
"sync"
)
func main() {
i := 0
package main
import "fmt"
func main() {
i := make(chan int)
go func() {
a := 0
a++
package main
import "fmt"
func main() {
i := make(chan int)
go func() {
a := 0
a++
WARNING: DATA RACE
Read at 0x00c00012c078 by goroutine 7:
main.main.func1()
H:/GolandProjects/concurrency_samples/main.go:11 +0x39
Previous write at 0x00c00012c078 by main goroutine:
main.main()
H:/GolandProjects/concurrency_samples/main.go:14 +0x116
Goroutine 7 (running) created at:
package main
import "fmt"
func main() {
wait := make(chan int)
i := 0
go func() {
package main
import (
"context"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
pb "grpc_example/gen/protos"
"io"
"log"
)
go get google.golang.org/grpc