Skip to content

Commit

Permalink
fix(deps): update go version (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
v-byte-cpu authored Sep 4, 2022
1 parent d420294 commit 045444e
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 639 deletions.
12 changes: 5 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@ clone:

steps:
- name: lint
image: golangci/golangci-lint:v1.42.0-alpine
image: golangci/golangci-lint:v1.49-alpine
volumes:
- name: deps
path: /go
commands:
- apk add libpcap-dev libc-dev linux-headers
- golangci-lint run -v
# go 1.16 install doesn't modify go.mod and go.sum
- go install github.com/mgechev/[email protected]
- go install github.com/mgechev/[email protected]
- revive -config .revive.toml -formatter friendly ./...

- name: test & build
image: golang:1.17-alpine
image: golang:1.19-alpine
volumes:
- name: deps
path: /go
Expand All @@ -40,7 +39,7 @@ steps:
- go build -ldflags "-w -s"

- name: goreleaser-snapshot
image: golang:1.17-alpine
image: golang:1.19-alpine
volumes:
- name: deps
path: /go
Expand Down Expand Up @@ -74,11 +73,10 @@ steps:
- git fetch --tags

- name: release
image: golang:1.17-alpine
image: golang:1.19-alpine
environment:
GITHUB_TOKEN:
from_secret: github_token
commands:
- apk add libpcap-dev libc-dev gcc linux-headers curl git
- curl -s https://raw.githubusercontent.com/goreleaser/get/master/get | sh

1 change: 0 additions & 1 deletion .revive.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ warningCode = 1
[rule.increment-decrement]
[rule.var-naming]
[rule.var-declaration]
[rule.package-comments]
[rule.range]
[rule.receiver-naming]
[rule.time-naming]
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:1.17-alpine as builder
FROM golang:1.19-alpine as builder

RUN apk add --no-cache libpcap-dev libc-dev gcc linux-headers
ADD . /app
WORKDIR /app
RUN go build -ldflags "-w -s -linkmode external -extldflags '-static'" -o /sx

FROM alpine:3.15
FROM alpine:3.16

COPY --from=builder /sx /sx
ENTRYPOINT ["/sx"]
5 changes: 2 additions & 3 deletions command/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"context"
"errors"
"io"
"io/ioutil"
"net"
"os"
"strconv"
Expand Down Expand Up @@ -360,7 +359,7 @@ func (o *ipPortScanCmdOpts) newIPPortGenerator() (reqgen scan.RequestGenerator)
}
ipgen := scan.NewFileIPGenerator(func() (io.ReadCloser, error) {
if o.ipFile == "-" {
return ioutil.NopCloser(os.Stdin), nil
return io.NopCloser(os.Stdin), nil
}
return os.Open(o.ipFile)
})
Expand Down Expand Up @@ -492,7 +491,7 @@ func (o *genericScanCmdOpts) newIPPortGenerator() (reqgen scan.RequestGenerator)
}
ipgen := scan.NewFileIPGenerator(func() (io.ReadCloser, error) {
if o.ipFile == "-" {
return ioutil.NopCloser(os.Stdin), nil
return io.NopCloser(os.Stdin), nil
}
return os.Open(o.ipFile)
})
Expand Down
5 changes: 2 additions & 3 deletions command/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package command
import (
"errors"
"io"
"io/ioutil"
"net"
"strings"
"testing"
Expand Down Expand Up @@ -912,7 +911,7 @@ func TestParseExcludeFile(t *testing.T) {
defer close(done)

ips, err := parseExcludeFile(func() (io.ReadCloser, error) {
return ioutil.NopCloser(strings.NewReader(tt.input)), nil
return io.NopCloser(strings.NewReader(tt.input)), nil
})
if tt.err {
require.Error(t, err)
Expand Down Expand Up @@ -1041,7 +1040,7 @@ func TestParsePortsFile(t *testing.T) {
defer close(done)

ports, err := parsePortsFile(func() (io.ReadCloser, error) {
return ioutil.NopCloser(strings.NewReader(tt.input)), nil
return io.NopCloser(strings.NewReader(tt.input)), nil
})
if tt.err {
require.Error(t, err)
Expand Down
49 changes: 36 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,29 +1,52 @@
module github.com/v-byte-cpu/sx

go 1.15
go 1.19

require (
github.com/docker/docker v20.10.7+incompatible
github.com/golang/mock v1.6.0
github.com/google/gopacket v1.1.20-0.20210304165259-20562ffb40f8
github.com/mailru/easyjson v0.7.7
github.com/moby/moby v20.10.7+incompatible
github.com/spf13/cobra v1.5.0
github.com/stretchr/testify v1.8.0
github.com/vishvananda/netlink v1.1.0
github.com/yl2chen/cidranger v1.0.2
go.uber.org/ratelimit v0.2.0
go.uber.org/zap v1.23.0
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d
)

require (
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect
github.com/containerd/containerd v1.4.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v20.10.7+incompatible
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/golang/mock v1.6.0
github.com/google/gopacket v1.1.20-0.20210304165259-20562ffb40f8
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/mailru/easyjson v0.7.7
github.com/moby/moby v20.10.7+incompatible
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/spf13/cobra v1.3.0
github.com/stretchr/testify v1.7.0
github.com/vishvananda/netlink v1.1.0
github.com/yl2chen/cidranger v1.0.2
go.uber.org/ratelimit v0.2.0
go.uber.org/zap v1.19.0
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
google.golang.org/grpc v1.42.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.0.3 // indirect
)
Loading

0 comments on commit 045444e

Please sign in to comment.