mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-09-27 03:15:55 +08:00
14 lines
141 B
Go
14 lines
141 B
Go
package slicex
|
|
|
|
import "fmt"
|
|
|
|
func ExampleSum() {
|
|
slice := []int{1, 2, 3, 4, 5}
|
|
res := Sum(slice)
|
|
|
|
fmt.Println(res)
|
|
|
|
// Output:
|
|
// 15
|
|
}
|