You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
// CopyOrder copies the order for the given parent scope to the given child scope.
func (n *constructorNode) CopyOrder(parent, child *Scope) {
n.orders[child] = n.orders[parent]
}
The text was updated successfully, but these errors were encountered:
It seems like you are accessing the container object in a concurrent manner.
Exposed methods on Container are not thread safe and should not be invoked from multiple goroutines. Out of curiosity, may I ask what you are using Dig for?
Container is not thread safe and is expected to be called from a single-thread. In general I recommend against using Dig directly in user-facing code (like router).
Good for:
Powering an application framework, e.g. [Fx](https://github.com/uber-go/fx).
Resolving the object graph during process startup.
Bad for:
Using in place of an application framework, e.g. [Fx](https://github.com/uber-go/fx).
Resolving dependencies after the process has already started.
Exposing to user-land code as a [Service Locator](https://martinfowler.com/articles/injection.html#UsingAServiceLocator).
Describe the bug
fatal error: concurrent map read and map write
goroutine 115 [running]:
go.uber.org/dig.(*constructorNode).CopyOrder(0x140002e3200, 0x14000168dc0, 0x14000800500)
/Users/cosmin/go/pkg/mod/go.uber.org/[email protected]/constructor.go:134 +0x40
go.uber.org/dig.(*Scope).Scope(0x14000168dc0, {0x102fc3dfb, 0x7}, {0x0, 0x0, 0x0})
/Users/cosmin/go/pkg/mod/go.uber.org/[email protected]/scope.go:127 +0x2b8
go.uber.org/dig.(*Container).Scope(0x140000807f8, {0x102fc3dfb, 0x7}, {0x0, 0x0, 0x0})
/Users/cosmin/go/pkg/mod/go.uber.org/[email protected]/container.go:259 +0x5c
To Reproduce
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
The text was updated successfully, but these errors were encountered: