Skip to content

Commit

Permalink
chore: added README
Browse files Browse the repository at this point in the history
  • Loading branch information
gebv committed May 13, 2020
1 parent 88f4e6d commit 534558b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
go test -v -timeout 5s -race -bench=. -run=. ./...
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Go primitives

Helper methods for golang primitives (no generics yet).

Types:

* [ ] Numbers
* [x] Int64s
* [ ] Float64s
* [ ] Strings
* [ ] Custom types (satisfying interface)

Tools:

* [ ] Go generate for primitives
* [ ] Numbers
* [ ] Strings
* [ ] Custom types

Methods for array: `Exists`, `Index`, `Len`, `Sort`, `Copy`, `Uniq`, `Filter`. Methods `Sort`, `Uniq`, `Filter` without allocate.
2 changes: 1 addition & 1 deletion int/int64s.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (v Int64s) Sort() {

// Copy creates a copy of the array.
func (v Int64s) Copy() Int64s {
return v[:]
return v.Filter(func(in int64) bool { return true })
}

// Uniq returns a unique set (without allocate).
Expand Down

0 comments on commit 534558b

Please # to comment.