mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
Update metrics/registry.go
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
This commit is contained in:
parent
04845621bc
commit
d6af162a15
1 changed files with 1 additions and 1 deletions
|
|
@ -328,7 +328,7 @@ func Get(name string) interface{} {
|
||||||
// GetOrRegister gets an existing metric or creates and registers a new one. Threadsafe
|
// GetOrRegister gets an existing metric or creates and registers a new one. Threadsafe
|
||||||
// alternative to calling Get and Register on failure.
|
// alternative to calling Get and Register on failure.
|
||||||
func GetOrRegister[T any](name string, ctor func() T, r Registry) interface{} {
|
func GetOrRegister[T any](name string, ctor func() T, r Registry) interface{} {
|
||||||
if nil == r {
|
if r == nil {
|
||||||
r = DefaultRegistry
|
r = DefaultRegistry
|
||||||
}
|
}
|
||||||
return r.GetOrRegister(name, func() any { return ctor() })
|
return r.GetOrRegister(name, func() any { return ctor() })
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue