diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..cc50b4b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +on: [push, pull_request] +name: Test +jobs: + test: + strategy: + matrix: + go-version: [1.18.x, 1.19.x] + os: [ubuntu-latest] + runs-on: ${{matrix.os}} + steps: + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{matrix.go-version}} + - name: Checkout + uses: actions/checkout@v2 + - name: gofmt + run: test -z "`gofmt -l .`" + - name: golint + run: test -z "`golint ./...`" + - name: go test + run: go test -v ./... + - name: Build example + run: cd example && ./linux64_build.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 625e173..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go -go: - - 1.13.x - - 1.14.x -before_install: - - go get -u golang.org/x/lint/golint - - go get github.com/axw/gocov/gocov - - go get github.com/mattn/goveralls -script: - - test -z "`gofmt -l .`" - - test -z "`golint ./...`" - - $GOPATH/bin/goveralls -service=travis-ci - - cd example && ./linux64_build.sh diff --git a/README.md b/README.md index 830b021..8408f54 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ Sonyflake ========= [![GoDoc](https://godoc.org/github.com/sony/sonyflake?status.svg)](http://godoc.org/github.com/sony/sonyflake) -[![Build Status](https://travis-ci.org/sony/sonyflake.svg?branch=master)](https://travis-ci.org/sony/sonyflake) -[![Coverage Status](https://coveralls.io/repos/sony/sonyflake/badge.svg?branch=master&service=github)](https://coveralls.io/github/sony/sonyflake?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/sony/sonyflake)](https://goreportcard.com/report/github.com/sony/sonyflake) Sonyflake is a distributed unique ID generator inspired by [Twitter's Snowflake](https://blog.twitter.com/2010/announcing-snowflake). diff --git a/sonyflake.go b/sonyflake.go index 80376b6..b316924 100644 --- a/sonyflake.go +++ b/sonyflake.go @@ -1,9 +1,10 @@ // Package sonyflake implements Sonyflake, a distributed unique ID generator inspired by Twitter's Snowflake. // // A Sonyflake ID is composed of -// 39 bits for time in units of 10 msec -// 8 bits for a sequence number -// 16 bits for a machine id +// +// 39 bits for time in units of 10 msec +// 8 bits for a sequence number +// 16 bits for a machine id package sonyflake import (