From 68b5c05e76e4e1e62c3191507979d7f9f6b18935 Mon Sep 17 00:00:00 2001 From: Osamu TONOMORI Date: Mon, 10 Oct 2022 14:43:52 +0900 Subject: [PATCH] Update support Go version --- .github/workflows/actions.yml | 13 +++++-------- README.md | 12 ++++++------ go.mod | 4 ++-- go.sum | 4 ++-- indigo_test.go | 2 +- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index cac467e..02678f6 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -11,24 +11,21 @@ on: jobs: lint: name: Lint - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - - uses: actions/setup-go@v3 - with: - go-version: 1.17 - uses: actions/checkout@v3 - uses: golangci/golangci-lint-action@v3 with: - version: v1.45.2 + version: v1.49.0 test: name: Test - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 strategy: matrix: - go: [ '1.16.x', '1.17.x', '1.18.x' ] + go: [ '1.18.x', '1.19.x' ] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} - run: go test -race -covermode=atomic -coverprofile=coverage.txt ./... diff --git a/README.md b/README.md index 88c4651..473bd38 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ ## Install ```shell -$ go get -u github.com/osamingo/indigo +$ go get github.com/osamingo/indigo@latest ``` ## Usage @@ -67,14 +67,14 @@ func main() { ## Benchmark ``` -# Machine: MacBook Pro (13-inch, 2018, Four Thunderbolt 3 Ports) -# CPU : 2.7 GHz Intel Core i7 -# Memory : 16 GB 2133 MHz LPDDR3 +# Machine: MacBook Pro (14-inch, 2021) +# CPU : Apple M1 Pro +# Memory : 32 GB goos: darwin -goarch: amd64 +goarch: arm64 pkg: github.com/osamingo/indigo -BenchmarkGenerator_NextID-8 30136 39099 ns/op 7 B/op 1 allocs/op +BenchmarkGenerator_NextID-10 30079 39191 ns/op 7 B/op 1 allocs/op PASS ``` diff --git a/go.mod b/go.mod index e981e37..29928a1 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/osamingo/indigo -go 1.15 +go 1.18 require ( github.com/osamingo/base58 v1.0.0 - github.com/sony/sonyflake v1.0.1-0.20200827011719-848d664ceea4 + github.com/sony/sonyflake v1.1.0 ) diff --git a/go.sum b/go.sum index 5ea501f..1d0483c 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ github.com/osamingo/base58 v1.0.0 h1:NhsHxeyMRaD5Li67LgdZG+4/rlyaNr9rVqYQxNGLOYg= github.com/osamingo/base58 v1.0.0/go.mod h1:nADsGCd4fm122SrLUaut+PhzCVwyvchAgxxBVDS5Wf8= -github.com/sony/sonyflake v1.0.1-0.20200827011719-848d664ceea4 h1:KPf4aWX4JGEdMICunm9A0YTFbD6OL23G14BR7cL/0wg= -github.com/sony/sonyflake v1.0.1-0.20200827011719-848d664ceea4/go.mod h1:LORtCywH/cq10ZbyfhKrHYgAUGH7mOBa76enV9txy/Y= +github.com/sony/sonyflake v1.1.0 h1:wnrEcL3aOkWmPlhScLEGAXKkLAIslnBteNUq4Bw6MM4= +github.com/sony/sonyflake v1.1.0/go.mod h1:LORtCywH/cq10ZbyfhKrHYgAUGH7mOBa76enV9txy/Y= diff --git a/indigo_test.go b/indigo_test.go index d627965..b5783ca 100644 --- a/indigo_test.go +++ b/indigo_test.go @@ -231,7 +231,7 @@ func BenchmarkGenerator_NextID(b *testing.B) { } } -func ExampleGenerator_NextID() { +func ExampleGenerator_NextID() { //nolint: nosnakecase const machineID = 65535 g := indigo.New(