3 ms·
Don't do it. Don't past non-request-scoped data through contexts, and none of these are request-scoped. You can trivially pass such values through middlewares u
by morelisp 3y ago
Don't do it. Don't past non-request-scoped data through contexts, and none of these are request-scoped. You can trivially pass such values through middlewares using methods or closures.
Also, while I think I know what "unlike Rust, these phantom types appear at runtime in Go" is saying, it's saying it in a really confusing way. These types do not "appear at runtime"; they are exactly like all other types, constructed at compile time and visible when interface-boxed at runtime. They're in no way "spectral".
- dazamarquez 3y ago"phantom" and "phantom type" are well-understood terms that describe a type with a type parameter that isn't used in the type definition. "spectral" is a pun (phantom -> spectral). It has nothing to do with runtime representation of types.