How Go Finds Std Libs
Usually, the go standard library is located under $GOROOT
and it's go compiler's scope to find the std libs, so most of the users needn't care about how the standard library is found by compiler.
When we want to combine 2 services into a single process, we need to solve the collision of global states between 2 services in the standard library. By duplicating it with another name(and all underlying dependent packages) under GOROOT, we can segregate the global states well even though they refer to the same package before combining. However, this requires to investigate how go compiler finds the std lib to ensure the approach won't break.