Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go close/deadlock exercise

The root files are the buggy TA version. REF/server.go is the corrected reference solution with optional logging.

Before the fix

Run the test from the repository root:

go test .

The test should fail after 100ms because the server tries to send an ACK after the client sends Close, but the client is no longer receiving responses.

After the fix and logs

Copy the contents of REF/server.go into the root server.go. If copying the whole file, remove its //go:build ignore line and the blank line after it so Go includes the file.

Run the corrected test:

go test -race .

Logging is controlled by the CLI boolean -log. Logs are off by default:

go test -v .

Turn them on with:

go test -race -v . -args -log

You can explicitly turn them off with -args -log=false.

About

demos for the go-debugging reci

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages