Profiling is a practice that can be used to measure the resources utilized in a computer system. Profiling is often done to understand the CPU or memory utilization within a program in order to optimize for execution time, size, or reliability.
https://pkg.go.dev/runtime/pprof?tab=doc
Articles of Go Profiling
Profiling with go test command
Usage:
go test [build/test flags] [packages] [build/test flags & test binary flags]