Skip to content

Commit

Permalink
packet: bump minimum version of Go to 1.18
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Layher <mdlayher@gmail.com>
  • Loading branch information
mdlayher committed Nov 12, 2022
1 parent cc18e34 commit 0b01331
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 95 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/linux-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ name: Linux Test
on:
push:
branches:
- '*'
- "*"
pull_request:
branches:
- '*'
- "*"

jobs:
build:
strategy:
fail-fast: false
matrix:
go-version: [1.17]
go-version: [1.18, 1.19]
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Build test binary
run: go test -c -race
- name: Build test binary
run: go test -c -race

# These tests run on Linux only. Apply capabilities and verify we can
# actually use real AF_PACKET sockets.
- name: Apply CAP_NET_RAW
run: sudo setcap cap_net_raw+ep ./packet.test
# These tests run on Linux only. Apply capabilities and verify we can
# actually use real AF_PACKET sockets.
- name: Apply CAP_NET_RAW
run: sudo setcap cap_net_raw+ep ./packet.test

- name: Run tests with capabilities
run: ./packet.test -test.v
- name: Run tests with capabilities
run: ./packet.test -test.v
44 changes: 22 additions & 22 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,42 @@ name: Static Analysis
on:
push:
branches:
- '*'
- "*"
pull_request:
branches:
- '*'
- "*"

jobs:
build:
strategy:
matrix:
go-version: [1.17]
go-version: [1.18, 1.19]
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest

- name: Print staticcheck version
run: staticcheck -version
- name: Print staticcheck version
run: staticcheck -version

- name: Run staticcheck
run: staticcheck ./...
- name: Run staticcheck
run: staticcheck ./...

- name: Install enumcheck
run: go install loov.dev/enumcheck@latest
- name: Install enumcheck
run: go install loov.dev/enumcheck@latest

- name: Run enumcheck
run: enumcheck ./...
- name: Run enumcheck
run: enumcheck ./...

- name: Run go vet
run: go vet ./...
- name: Run go vet
run: go vet ./...
28 changes: 14 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ name: Test
on:
push:
branches:
- '*'
- "*"
pull_request:
branches:
- '*'
- "*"

jobs:
build:
strategy:
fail-fast: false
matrix:
go-version: [1.12, 1.17]
go-version: [1.18, 1.19]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check out code into the Go module directory
uses: actions/checkout@v3

# Run basic tests, we just want to make sure there is parity on Linux and
# macOS, and back to the oldest version of Go this library supports.
- name: Run tests
run: go test ./...
# Run basic tests, we just want to make sure there is parity on Linux and
# macOS, and back to the oldest version of Go this library supports.
- name: Run tests
run: go test ./...
32 changes: 16 additions & 16 deletions .github/workflows/unsupported.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ name: Unsupported
on:
push:
branches:
- '*'
- "*"
pull_request:
branches:
- '*'
- "*"

jobs:
build:
strategy:
fail-fast: false
matrix:
go-version: [1.17]
go-version: [1.18]
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check out code into the Go module directory
uses: actions/checkout@v3

# Although this package doesn't support Windows, we want to verify that
# everything builds properly.
- name: Verify build for non-UNIX platforms
run: go build
env:
GOOS: windows
# Although this package doesn't support Windows, we want to verify that
# everything builds properly.
- name: Verify build for non-UNIX platforms
run: go build
env:
GOOS: windows
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ Licensed.
See the [CHANGELOG](./CHANGELOG.md) file for a description of changes between
releases.

In order to reduce the maintenance burden, this package is only supported on
Go 1.12+. Older versions of Go lack critical features and APIs which are
necessary for this package to function correctly.
This package has a stable v1 API and any future breaking changes will prompt
the release of a new major version. Features and bug fixes will continue to
occur in the v1.x.x series.

**If you depend on this package in your applications, please use Go modules.**
This package only supports the two most recent major versions of Go, mirroring
Go's own release policy. Older versions of Go may lack critical features and bug
fixes which are necessary for this package to function correctly.

## History

Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/mdlayher/packet

go 1.17
go 1.18

require (
github.com/google/go-cmp v0.5.7
github.com/google/go-cmp v0.5.9
github.com/josharian/native v1.0.0
github.com/mdlayher/socket v0.3.0
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
golang.org/x/sys v0.0.0-20220325203850-36772127a21f
github.com/mdlayher/socket v0.4.0
golang.org/x/net v0.2.0
golang.org/x/sys v0.2.0
)

require golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
require golang.org/x/sync v0.1.0 // indirect
25 changes: 10 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/josharian/native v1.0.0 h1:Ts/E8zCSEsG17dUqv7joXJFybuMLjQfWE04tsBODTxk=
github.com/josharian/native v1.0.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
github.com/mdlayher/socket v0.3.0 h1:5uBFDxXmTsxt5GZ7Xya8AEDZwPmM8k4F6I5wFFhksrM=
github.com/mdlayher/socket v0.3.0/go.mod h1:vqyG8Q7TGpPsuonhoyV5JkrV5U+aizNczu3h4MMwLSg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c h1:uOCk1iQW6Vc18bnC13MfzScl+wdKBmM9Y9kU7Z83/lw=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20220325203850-36772127a21f h1:TrmogKRsSOxRMJbLYGrB4SBbW+LJcEllYBLME5Zk5pU=
golang.org/x/sys v0.0.0-20220325203850-36772127a21f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
github.com/mdlayher/socket v0.4.0 h1:280wsy40IC9M9q1uPGcLBwXpcTQDtoGwVt+BNoITxIw=
github.com/mdlayher/socket v0.4.0/go.mod h1:xxFqz5GRCUN3UEOm9CZqEJsAbe1C8OwSK46NlmWuVoc=
golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

0 comments on commit 0b01331

Please sign in to comment.