Skip to content

xbc30/godash

Repository files navigation

Godash

image

Example

  • With Type Input
package main

import (
  "fmt"

  "github.com/xbc30/godash"
)

func main() {
  input := []int{1,2,3,4,5}
  output := godash.ArrayIntChunk(input, 2)
  fmt.Println(output) // [[1,2] [3,4] [5]]
}
  • interface{} Input
package main

import (
  "fmt"

  "github.com/xbc30/godash"
)

func main() {
  input := []int{1,2,3,4,5}
  output := godash.ArrayChunk(godash.ArrayIntToInterface(input), 2)
  fmt.Println(output) // [][]interface{}{{1, 2}, {3, 4}, {5}}
}

List

Unit Test & Benchmark Test

  • Unit Test

    • Single Func Test
      go test -v -run="TestArrayIntChunk" -count 1
    • File Test
      go test -v -run="" -count 1
  • Benchmark Test

go test --bench=. array_test.go array.go -benchmem

About

Lodash for Golang

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages