diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index cebbfaff..97b3887b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -44,7 +44,7 @@ jobs: name: Test strategy: matrix: - go-version: [ 1.13.x, 1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x ] + go-version: [ 1.16.x, 1.17.x, 1.18.x, 1.19.x ] platform: [ ubuntu-latest, macos-latest, windows-latest ] runs-on: ${{ matrix.platform }} steps: diff --git a/.golangci.yml b/.golangci.yml index 631e3692..479ac812 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,16 +9,13 @@ linters-settings: linters: enable: - - deadcode + - unused - errcheck - gosimple - govet - ineffassign - staticcheck - - structcheck - typecheck - - unused - - varcheck - nakedret - gofmt - rowserrcheck diff --git a/README.md b/README.md index d018ad53..35b1f416 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Package git-module is a Go module for Git access through shell commands. ## Requirements -- Go version must be at least **1.13**. +- Go version must be at least **1.16**. - Git version must be no less than **1.8.3**. - For Windows users, try to use the latest version of both. diff --git a/diff_test.go b/diff_test.go index eaa1ba93..db8a7b51 100644 --- a/diff_test.go +++ b/diff_test.go @@ -102,8 +102,8 @@ func TestDiffFile(t *testing.T) { LeftLine: 0, RightLine: 1, }, { - Type: DiffLineAdd, - Content: `+ path = gogs/docs-api`, + Type: DiffLineAdd, + Content: `+ path = gogs/docs-api`, LeftLine: 0, RightLine: 2, }, @@ -203,13 +203,13 @@ index 0000000..6b08f76 LeftLine: 0, RightLine: 1, }, { - Type: DiffLineAdd, - Content: `+ path = gogs/docs-api`, + Type: DiffLineAdd, + Content: `+ path = gogs/docs-api`, LeftLine: 0, RightLine: 2, }, { - Type: DiffLineAdd, - Content: `+ url = https://github.com/gogs/docs-api.git`, + Type: DiffLineAdd, + Content: `+ url = https://github.com/gogs/docs-api.git`, LeftLine: 0, RightLine: 3, }, @@ -719,8 +719,8 @@ index 0000000..6abde17 LeftLine: 0, RightLine: 1, }, { - Type: DiffLineAdd, - Content: `+ path = gogs/docs-api`, + Type: DiffLineAdd, + Content: `+ path = gogs/docs-api`, LeftLine: 0, RightLine: 2, }, @@ -783,8 +783,8 @@ index 0000000..6b08f76 LeftLine: 0, RightLine: 1, }, { - Type: DiffLineAdd, - Content: `+ path = gogs/docs-api`, + Type: DiffLineAdd, + Content: `+ path = gogs/docs-api`, LeftLine: 0, RightLine: 2, }, diff --git a/go.mod b/go.mod index 345890ac..6da0097b 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/gogs/git-module -go 1.13 +go 1.16 require ( github.com/mcuadros/go-version v0.0.0-20190308113854-92cdf37c5b75 - github.com/stretchr/testify v1.8.0 + github.com/stretchr/testify v1.8.1 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e ) diff --git a/go.sum b/go.sum index 2941a4d2..f414adcb 100644 --- a/go.sum +++ b/go.sum @@ -7,9 +7,11 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/signature.go b/signature.go index 981a4919..a35f7bab 100644 --- a/signature.go +++ b/signature.go @@ -23,8 +23,10 @@ type Signature struct { // parseSignature parses signature information from the (uncompressed) commit // line, which looks like the following but without the "author " at the // beginning: -// author Patrick Gundlach <gundlach@speedata.de> 1378823654 +0200 -// author Patrick Gundlach <gundlach@speedata.de> Thu Apr 07 22:13:13 2005 +0200 +// +// author Patrick Gundlach <gundlach@speedata.de> 1378823654 +0200 +// author Patrick Gundlach <gundlach@speedata.de> Thu Apr 07 22:13:13 2005 +0200 +// // This method should only be used for parsing author and committer. func parseSignature(line []byte) (*Signature, error) { emailStart := bytes.IndexByte(line, '<')