A simple update stock demo with goroutine, sync.Mutex, sync.Waitgroup implementation
Before you running the program, make sure you've run this command:
go mod tidy
go run main.go
go run -race main.go
for build-in race detector
The program will run on http://localhost:9090
Method | URL | Description |
---|---|---|
GET | localhost:9090/update-stock | Update Stock Demo |
GET | localhost:9090/update-stock-race | Update Stock Demo with Race Condition Example |