1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-09 15:12:26 +08:00

feat: add Range function

This commit is contained in:
dudaodong
2023-03-06 17:49:56 +08:00
parent 6a9eb645bb
commit 28d0428b50
3 changed files with 49 additions and 0 deletions

View File

@@ -185,3 +185,21 @@ func ExampleMinBy() {
// ab
//
}
func ExampleRange() {
result1 := Range(1, 4)
result2 := Range(1, -4)
result3 := Range(-4, 4)
result4 := Range(1.0, 4)
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
fmt.Println(result4)
// Output:
// [1 2 3 4]
// [1 2 3 4]
// [-4 -3 -2 -1]
// [1 2 3 4]
}