Concurrency and Packages
Client and Worker Files
Larger Go programs split request creation from worker handling. This replay comes from one execution that moves from the client file into the worker file and back with the response data.
Project Entry
request_client.go
package main
import "fmt"
func main() {
var command =
request := map[string]string{"command": command, "user": "reader"}
response := handleRequest(request)
fmt.Println("send=", request["command"])
fmt.Println("route=", response.Route)
fmt.Println("body=", response.Body)
fmt.Println("user=", request["user"])
}
package main
import "fmt"
func main() {
var command =
request := map[string]string{"command": command, "user": "reader"}
response := handleRequest(request)
fmt.Println("send=", request["command"])
fmt.Println("route=", response.Route)
fmt.Println("body=", response.Body)
fmt.Println("user=", request["user"])
}
package main
import "fmt"
func main() {
var command =
request := map[string]string{"command": command, "user": "reader"}
response := handleRequest(request)
fmt.Println("send=", request["command"])
fmt.Println("route=", response.Route)
fmt.Println("body=", response.Body)
fmt.Println("user=", request["user"])
}
file panels
The entry file builds a request map, then calls a worker helper in another source file. Replay keeps both files in one trace stream, so the Variables panel follows the real call and return order.