Skip to content

Commit

Permalink
API change and bump go version
Browse files Browse the repository at this point in the history
  • Loading branch information
gaissmai committed Jan 6, 2024
1 parent 8a280f4 commit f181c5e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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 ./...
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 5 additions & 12 deletions example_period_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package interval_test

import (
"cmp"
"fmt"
"os"

Expand All @@ -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
Expand Down

0 comments on commit f181c5e

Please sign in to comment.