Here is a simple example. Both packages track whether or not they've started using the key "started". A.Start calls B.Start. B.Start panics because it thinks its already started.
package mainimport "context"func main() { A.Start(context.Background())}package Aimport "context"func Start(ctx context.Context) { if ctx.Value("started") == true { panic("already started") } newCtx := context.WithValue(ctx, "started", true) B.Start(newCtx)}package Bimport "context"func Start(ctx context.Context) { if ctx.Value("started") == true { panic("already started") }}