Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 16 additions & 26 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,19 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Install gotip
run: |
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin:$PATH" >> $GITHUB_PATH
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Test
run: go test -v ./...
# - name: Upload coverage report
# uses: codecov/codecov-action@v2.1.0
# with:
# token: 7106da3d-7479-471f-ae37-e3680b62063d
# files: ./coverage.txt
# flags: unittests
# name: codecov-umbrella
- uses: actions/checkout@master
with:
fetch-depth: 2
- uses: actions/setup-go@v2
with:
go-version: '1.18'
- name: Run tests with coverage
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ./coverage.out # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18beta1-alpine
FROM golang:1.18-alpine

WORKDIR /lib

Expand Down
2 changes: 1 addition & 1 deletion chain/chain.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package chain

import (
"constraints"
"golang.org/x/exp/constraints"

u "github.com/rjNemo/underscore"
)
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ module github.com/rjNemo/underscore

go 1.18

require github.com/stretchr/testify v1.7.0
require (
github.com/stretchr/testify v1.7.0
golang.org/x/exp v0.0.0-20220314205449-43aec2f8a4e7
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/exp v0.0.0-20220314205449-43aec2f8a4e7 h1:jynE66seADJbyWMUdeOyVTvPtBZt7L6LJHupGwxPZRM=
golang.org/x/exp v0.0.0-20220314205449-43aec2f8a4e7/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
2 changes: 1 addition & 1 deletion max.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package underscore

import "constraints"
import "golang.org/x/exp/constraints"

// Max returns the maximum value in the slice.
// This function can currently only compare numbers reliably.
Expand Down
2 changes: 1 addition & 1 deletion min.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package underscore

import "constraints"
import "golang.org/x/exp/constraints"

// Min returns the minimum value in the slice.
// This function can currently only compare numbers reliably.
Expand Down
2 changes: 1 addition & 1 deletion sum.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package underscore

import "constraints"
import "golang.org/x/exp/constraints"

// Sum adds elements of the slice.
func Sum[T constraints.Ordered](values []T) (sum T) {
Expand Down