Skip to content

Commit

Permalink
Switching to Go 1.17 (#259)
Browse files Browse the repository at this point in the history
* Switching to go mod 1.17

* Associated files

* Updating golangci-lint
  • Loading branch information
fclairamb authored Dec 28, 2021
1 parent 529fafa commit 29f1d95
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:

strategy:
matrix:
go: [ 1.16, 1.15 ]
go: [ 1.17, 1.16, 1.15 ]
include:
- go: 1.16
- go: 1.17
lint: true

# Steps represent a sequence of tasks that will be executed as part of the job
Expand All @@ -30,7 +30,7 @@ jobs:
if: matrix.lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.33
version: v1.43.0

# Install Go
- name: Setup go
Expand Down
11 changes: 7 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ linters-settings:
# enable or disable analyzers by name
enable:
- atomicalign
# - fieldalignment
enable-all: false
disable:
- shadow
Expand Down Expand Up @@ -183,16 +184,17 @@ linters:
- goerr113
- gofmt
- goimports
- golint
# - golint --> revive
- revive
# - gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
# - interfacer --> (deprecated)
- lll
- maligned
# - maligned --> govet:fieldalignment
- megacheck
- misspell
- nakedret
Expand All @@ -201,7 +203,8 @@ linters:
- prealloc
- nolintlint
- rowserrcheck
- scopelint
# - scopelint --> exportloopref
- exportloopref
- staticcheck
- structcheck
- stylecheck
Expand Down
2 changes: 1 addition & 1 deletion asciiconverter.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ftpserver // nolint
package ftpserver

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion client_handler.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ftpserver // nolint
package ftpserver

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion consts.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ftpserver // nolint
package ftpserver

// from @stevenh's PR proposal
// https://github.com/fclairamb/ftpserverlib/blob/becc125a0770e3b670c4ced7e7bd12594fb024ff/server/consts.go
Expand Down
2 changes: 1 addition & 1 deletion control_unix.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build linux || freebsd || darwin || aix || dragonfly || netbsd || openbsd || solaris
// +build linux freebsd darwin aix dragonfly netbsd openbsd solaris

package ftpserver // nolint
package ftpserver

import (
"syscall"
Expand Down
2 changes: 1 addition & 1 deletion driver.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ftpserver // nolint
package ftpserver

import (
"crypto/tls"
Expand Down
2 changes: 1 addition & 1 deletion errors.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ftpserver // nolint
package ftpserver

import "errors"

Expand Down
29 changes: 28 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/fclairamb/ftpserverlib

go 1.16
go 1.17

require (
github.com/fclairamb/go-log v0.1.0
Expand All @@ -11,4 +11,31 @@ require (
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
)

require (
cloud.google.com/go v0.75.0 // indirect
cloud.google.com/go/storage v1.14.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 // indirect
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 // indirect
golang.org/x/text v0.3.5 // indirect
golang.org/x/tools v0.1.2 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/api v0.40.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/grpc v1.38.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

replace github.com/secsy/goftp => github.com/drakkan/goftp v0.0.0-20201220151643-27b7174e8caf
8 changes: 3 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,13 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
Expand Down Expand Up @@ -284,7 +287,6 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down Expand Up @@ -317,8 +319,6 @@ github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/afero v1.7.0 h1:xc1yh8vgcNB8yQ+UqY4cpD56Ogo573e+CJ/C4YmMFTg=
github.com/spf13/afero v1.7.0/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo=
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
Expand Down Expand Up @@ -358,7 +358,6 @@ golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnf
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand Down Expand Up @@ -517,7 +516,6 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
Expand Down
2 changes: 1 addition & 1 deletion handle_auth.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ftpserver // nolint
package ftpserver

import (
"crypto/tls"
Expand Down
2 changes: 1 addition & 1 deletion handle_dirs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ftpserver // nolint
package ftpserver

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion handle_files.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ftpserver // nolint
package ftpserver

import (
"crypto/md5" //nolint:gosec
Expand Down
2 changes: 1 addition & 1 deletion handle_files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ func TestCustomHASHCommands(t *testing.T) {

tempFile, err := ioutil.TempFile("", "ftpserver")
require.NoError(t, err)
_, err = tempFile.Write([]byte("sample data with know checksum/hash\n"))
_, err = tempFile.WriteString("sample data with know checksum/hash\n")
require.NoError(t, err)

ftpUpload(t, c, tempFile, "file.txt")
Expand Down
2 changes: 1 addition & 1 deletion handle_misc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ftpserver // nolint
package ftpserver

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion transfer_active.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ftpserver // nolint
package ftpserver

import (
"crypto/tls"
Expand Down
2 changes: 1 addition & 1 deletion transfer_active_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func testRegexMatch(t *testing.T, regexp *regexp.Regexp, strings []string, expectedMatch bool) {
for _, s := range strings {
if regexp.Match([]byte(s)) != expectedMatch {
if regexp.MatchString(s) != expectedMatch {
t.Errorf("Invalid match result: %s", s)
}
}
Expand Down
2 changes: 1 addition & 1 deletion transfer_pasv.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ftpserver // nolint
package ftpserver

import (
"crypto/tls"
Expand Down
4 changes: 2 additions & 2 deletions transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ func TestPASVIPMatch(t *testing.T) {

func loginConnection(t *testing.T, conn net.Conn) {
buf := make([]byte, 1024)
_, err := conn.Write([]byte(fmt.Sprintf("USER %v\r\n", authUser)))
_, err := fmt.Fprintf(conn, "USER %v\r\n", authUser)
require.NoError(t, err)

n, err := conn.Read(buf)
Expand All @@ -1021,7 +1021,7 @@ func loginConnection(t *testing.T, conn net.Conn) {
resp := string(buf[:n])
require.True(t, strings.HasPrefix(resp, "331"))

_, err = conn.Write([]byte(fmt.Sprintf("PASS %v\r\n", authPass)))
_, err = fmt.Fprintf(conn, "PASS %v\r\n", authPass)
require.NoError(t, err)

n, err = conn.Read(buf)
Expand Down

0 comments on commit 29f1d95

Please sign in to comment.