mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-05 21:47:36 +03:00
Make the GetInstance concurrent test more readable
This commit is contained in:
parent
6e2be7f95f
commit
6f7b48202e
2 changed files with 33 additions and 14 deletions
|
@ -14,7 +14,7 @@ var (
|
|||
)
|
||||
|
||||
// GetInstance returns an existing instance of object. If it is not yet created, calls `constructor`, stores the
|
||||
// result for future calls and return it
|
||||
// result for future calls and returns it
|
||||
func GetInstance[T any](constructor func() T) T {
|
||||
var v T
|
||||
name := reflect.TypeOf(v).String()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue