func Sum[T int | float64](nums []T) T var total T for _, v := range nums total += v
Go ships with testing package. No need for JUnit or Mocha. GoLang- The Ultimate Guide 2023
Google, Uber, Twitch, Dropbox, Docker, Kubernetes, Prometheus, Terraform, Cilium, InfluxDB, and many CNCF projects. func Sum[T int | float64](nums []T) T var
Only for Members
You must be a member in order to access this content
func Sum[T int | float64](nums []T) T var total T for _, v := range nums total += v
Go ships with testing package. No need for JUnit or Mocha.
Google, Uber, Twitch, Dropbox, Docker, Kubernetes, Prometheus, Terraform, Cilium, InfluxDB, and many CNCF projects.