mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-16 20:25:32 +08:00
16 lines
203 B
Go
16 lines
203 B
Go
|
package log
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"math/rand"
|
||
|
)
|
||
|
|
||
|
type idContext struct {
|
||
|
context.Context
|
||
|
id uint32
|
||
|
}
|
||
|
|
||
|
func ContextWithID(ctx context.Context) context.Context {
|
||
|
return &idContext{ctx, rand.Uint32()}
|
||
|
}
|