There is golang package to create and use a worker pool to limit the number of Goroutines that run at the same time in Go application.
Look example at example folder:
go run ./examples/workerpool
Or run this example in playground: https://go.dev/play/p/QOEHdA2RiPm