|
return context.WithValue(context.Background(), consts.RequestIDLabel, requestID) |
https://golang.org/pkg/context/#WithValue
The provided key must be comparable and should not be of type string or any other built-in type to avoid collisions between packages using context. Users of WithValue should define their own types for keys. To avoid allocating when assigning to an interface{}, context keys often have concrete type struct{}. Alternatively, exported context key variables' static type should be a pointer or interface.
ibmcloud-object-storage-plugin/utils/logger/logger.go
Line 142 in 9104fee
https://golang.org/pkg/context/#WithValue
The provided key must be comparable and should not be of type string or any other built-in type to avoid collisions between packages using context. Users of WithValue should define their own types for keys. To avoid allocating when assigning to an interface{}, context keys often have concrete type struct{}. Alternatively, exported context key variables' static type should be a pointer or interface.