diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f470204..41a6185 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -12,7 +12,7 @@ jobs: test: strategy: matrix: - go-version: ['1.20'] + go-version: ['1.21'] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: @@ -27,7 +27,7 @@ jobs: steps: - uses: golang/govulncheck-action@v1 with: - go-version-input: 1.20 + go-version-input: 1.21 check-latest: true coverage: @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: 1.20 + go-version: 1.21 - name: Test Coverage run: go test -v -coverprofile=profile.cov ./... @@ -51,7 +51,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: 1.20 + go-version: 1.21 - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/README.md b/README.md index cd7d039..4a791c1 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ## API CHANGE !!! -The API has changed from v0.1.0 to v0.2.0 +The API has changed from v0.9.1 to v0.10.0 ## Overview diff --git a/example_period_test.go b/example_period_test.go index ceab64a..df7a45a 100644 --- a/example_period_test.go +++ b/example_period_test.go @@ -1,6 +1,7 @@ package interval_test import ( + "cmp" "fmt" "os" @@ -12,18 +13,10 @@ type uintInterval [2]uint // cmp function for uintInterval func cmpUintInterval(p, q uintInterval) (ll, rr, lr, rl int) { - return cmpUint(p[0], q[0]), cmpUint(p[1], q[1]), cmpUint(p[0], q[1]), cmpUint(p[1], q[0]) -} - -// little helper -func cmpUint(a, b uint) int { - switch { - case a == b: - return 0 - case a < b: - return -1 - } - return 1 + return cmp.Compare(p[0], q[0]), + cmp.Compare(p[1], q[1]), + cmp.Compare(p[0], q[1]), + cmp.Compare(p[1], q[0]) } // example data