Set up A Secondary Git Account
This blog explains how to set up a secondary git account for a project rather than using the global git configuration.
This blog explains how to set up a secondary git account for a project rather than using the global git configuration.
Go language supports to put modules under a VCS, such as github. Usually, one git repo contains one go module and multiple packages under this module. However, this is not always correct because Go allows you to put multiple modules under the same project, and Go helps to find these modules via its path. A typical example is repository go.opentelemetry.io/otel
, which contains huge amount of modules.
In my real senario, given a list of used modules parsing from go.mod
, and a package name retrieving from import declaration, I want to know which module does this package belong to. strings.Contain
isn't help at all because module paths have overlapped a lot.
Last week, users have reported a weird issue because they found:
This issue is complicated due to the involved components and the cross services. It takes me a lot of time to troubleshoot and finally I found the root cause successfully. The issue happened because user used gin.Context
as context.Context
directly inside a spawned go routine, however, gin tries to reuse the gin.Context
for another request. As a result, the go routine spawned by previous request will be affected by the new request, and the request id mingles.
Recently, I have help to troubleshooting the Go type alias issue inside packages.Load
, which relates x/tools
, go list
and cmd/compile
. My original CL is correct, but I got confused when I found the exportdata contains all aliases regardless gotypealias
setting. Then, tim has shepherded my CL by another CL to fix it.
Feel a bit frustrated when I saw the email when I got up. But it helps me a lot to learn how go toolchain and cmd/compile
works. Think twice before you act!
In CL 614975, I have migrated deprecated loader from ssa
package. However, miller has reported the tests became extremely slows. In an operation-system with a slow file system, such as plan9, the test slowed by more than 50x.
Oops, a un-intentional change:( I have submitted a CL to load 300+ packages by packages.Load
once instead of loading them many. Alan thought it's a bravo change:)
Moreover, when I involved to investigate why the packages.Load
slows so much, I have learned a lot. This blog records how I investigate them.