Setting a request header with or without Context in Golang
Long form comment:  Yes, the context version.  I'd consider it a bad pattern to modify incoming data inline (because it's harder to track later what came in and what the application did with it).  Especially in applications which do not only handle HTTP traffic, but also, say, gRPC calls, it's even more important that this data isn't stored for one type of handler only, but for all of them in a unified fashion.  Plus, context is (for better and worse) a kitchen sink for all layers of the code, even in the deepest layers you'll still be able to get that ID for various purposes, maybe auditing, or so.

Maybe it doesn't even need to go into the context, simply add it to the logger data (if there's such a thing), or however else that's being populated.  Doing that in a wrapper like this will again allow you to keep it out of the rest of the application - problem solved and no need to mess with the context object.  In any case it's not difficult to change that later.