Skip to content

Commit

Permalink
Merge pull request #3247 from lucas-clemente/drop-go-115
Browse files Browse the repository at this point in the history
drop support for Go 1.15
  • Loading branch information
marten-seemann authored Aug 5, 2021
2 parents 346bd63 + 68e468a commit 8ecbb05
Show file tree
Hide file tree
Showing 30 changed files with 93 additions and 209 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ jobs:
workflows:
workflow:
jobs:
- go115
- go116
2 changes: 1 addition & 1 deletion .github/workflows/cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [ "1.15.x", "1.16.x", "1.17.0-rc1" ]
go: [ "1.16.x", "1.17.0-rc1" ]
runs-on: ubuntu-latest
name: "Cross Compilation (Go ${{matrix.go}})"
steps:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/go-generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -e
DIR=$(pwd)
TMP=$(mktemp -d)
cd "$TMP"
mkdir orig generated
cp -r "$DIR" orig
cp -r "$DIR" generated

Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/go-generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.16.x"
- name: Install dependencies
run: go build
- name: Install code generators
Expand All @@ -13,7 +15,4 @@ jobs:
go install -v github.com/golang/mock/mockgen
go install -v golang.org/x/tools/cmd/goimports
- name: Run code generators
run: |
export GOPATH=$(go env GOPATH)
export PATH=$PATH:$GOPATH/bin
.github/workflows/go-generate.sh
run: .github/workflows/go-generate.sh
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [ "1.15.x", "1.16.x", "1.17.0-rc1" ]
go: [ "1.16.x", "1.17.0-rc1" ]
runs-on: ubuntu-latest
env:
DEBUG: false # set this to true to export qlogs and save them as artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
fail-fast: false
matrix:
os: [ "ubuntu", "windows", "macos" ]
go: [ "1.15.x", "1.16.x", "1.17.0-rc1" ]
go: [ "1.16.x", "1.17.0-rc1" ]
runs-on: ${{ matrix.os }}-latest
name: Unit tests (${{ matrix.os}}, Go ${{ matrix.go }})
steps:
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
module github.com/lucas-clemente/quic-go

go 1.15
go 1.16

require (
github.com/cheekybits/genny v1.0.0
github.com/francoispqt/gojay v1.2.13
github.com/golang/mock v1.6.0
github.com/marten-seemann/qpack v0.2.1
github.com/marten-seemann/qtls-go1-15 v0.1.5
github.com/marten-seemann/qtls-go1-16 v0.1.4
github.com/marten-seemann/qtls-go1-17 v0.1.0-rc.1
github.com/onsi/ginkgo v1.16.4
Expand Down
4 changes: 1 addition & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/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/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
Expand All @@ -82,8 +81,6 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN
github.com/marten-seemann/qpack v0.2.1 h1:jvTsT/HpCn2UZJdP+UUB53FfUUgeOyG5K1ns0OJOGVs=
github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc=
github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I=
github.com/marten-seemann/qtls-go1-15 v0.1.5 h1:Ci4EIUN6Rlb+D6GmLdej/bCQ4nPYNtVXQB+xjiXE1nk=
github.com/marten-seemann/qtls-go1-15 v0.1.5/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I=
github.com/marten-seemann/qtls-go1-16 v0.1.4 h1:xbHbOGGhrenVtII6Co8akhLEdrawwB2iHl5yhJRpnco=
github.com/marten-seemann/qtls-go1-16 v0.1.4/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk=
github.com/marten-seemann/qtls-go1-17 v0.1.0-rc.1 h1:/rpmWuGvceLwwWuaKPdjpR4JJEUH0tq64/I3hvzaNLM=
Expand Down Expand Up @@ -165,6 +162,7 @@ golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTk
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down
17 changes: 8 additions & 9 deletions integrationtests/self/cancelation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"math/rand"
"net"
"sync"
Expand Down Expand Up @@ -94,7 +93,7 @@ var _ = Describe("Stream Cancelations", func() {
str.CancelRead(quic.StreamErrorCode(str.StreamID()))
return
}
data, err := ioutil.ReadAll(str)
data, err := io.ReadAll(str)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal(PRData))
}()
Expand Down Expand Up @@ -135,14 +134,14 @@ var _ = Describe("Stream Cancelations", func() {
// only read some data from about 1/3 of the streams
if rand.Int31()%3 != 0 {
length := int(rand.Int31n(int32(len(PRData) - 1)))
data, err := ioutil.ReadAll(io.LimitReader(str, int64(length)))
data, err := io.ReadAll(io.LimitReader(str, int64(length)))
Expect(err).ToNot(HaveOccurred())
str.CancelRead(quic.StreamErrorCode(str.StreamID()))
Expect(data).To(Equal(PRData[:length]))
atomic.AddInt32(&canceledCounter, 1)
return
}
data, err := ioutil.ReadAll(str)
data, err := io.ReadAll(str)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal(PRData))
}()
Expand Down Expand Up @@ -225,7 +224,7 @@ var _ = Describe("Stream Cancelations", func() {
defer wg.Done()
str, err := sess.AcceptUniStream(context.Background())
Expect(err).ToNot(HaveOccurred())
data, err := ioutil.ReadAll(str)
data, err := io.ReadAll(str)
if err != nil {
atomic.AddInt32(&counter, 1)
Expect(err).To(MatchError(&quic.StreamError{
Expand Down Expand Up @@ -375,7 +374,7 @@ var _ = Describe("Stream Cancelations", func() {
str.CancelRead(quic.StreamErrorCode(str.StreamID()))
return
}
data, err := ioutil.ReadAll(str)
data, err := io.ReadAll(str)
if err != nil {
Expect(err).To(MatchError(&quic.StreamError{
StreamID: str.StreamID(),
Expand Down Expand Up @@ -464,7 +463,7 @@ var _ = Describe("Stream Cancelations", func() {
length = int(rand.Int31n(int32(len(PRData) - 1)))
r = io.LimitReader(str, int64(length))
}
data, err := ioutil.ReadAll(r)
data, err := io.ReadAll(r)
if err != nil {
Expect(err).To(MatchError(&quic.StreamError{
StreamID: str.StreamID(),
Expand Down Expand Up @@ -547,7 +546,7 @@ var _ = Describe("Stream Cancelations", func() {
}
return
}
data, err := ioutil.ReadAll(str)
data, err := io.ReadAll(str)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal(PRData))
wg.Done()
Expand Down Expand Up @@ -617,7 +616,7 @@ var _ = Describe("Stream Cancelations", func() {
Expect(err).ToNot(HaveOccurred())
go func(str quic.ReceiveStream) {
defer GinkgoRecover()
data, err := ioutil.ReadAll(str)
data, err := io.ReadAll(str)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal(PRData))
wg.Done()
Expand Down
4 changes: 2 additions & 2 deletions integrationtests/self/conn_id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package self_test
import (
"context"
"fmt"
"io/ioutil"
"io"
"math/rand"
"net"

Expand Down Expand Up @@ -54,7 +54,7 @@ var _ = Describe("Connection ID lengths tests", func() {
defer cl.CloseWithError(0, "")
str, err := cl.AcceptStream(context.Background())
Expect(err).ToNot(HaveOccurred())
data, err := ioutil.ReadAll(str)
data, err := io.ReadAll(str)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal(PRData))
}
Expand Down
6 changes: 3 additions & 3 deletions integrationtests/self/deadline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package self_test
import (
"context"
"fmt"
"io/ioutil"
"io"
"net"
"time"

Expand Down Expand Up @@ -138,7 +138,7 @@ var _ = Describe("Stream deadline tests", func() {
done := make(chan struct{})
go func() {
defer GinkgoRecover()
data, err := ioutil.ReadAll(serverStr)
data, err := io.ReadAll(serverStr)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal(PRDataLong))
close(done)
Expand Down Expand Up @@ -171,7 +171,7 @@ var _ = Describe("Stream deadline tests", func() {
readDone := make(chan struct{})
go func() {
defer GinkgoRecover()
data, err := ioutil.ReadAll(serverStr)
data, err := io.ReadAll(serverStr)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal(PRDataLong))
close(readDone)
Expand Down
4 changes: 2 additions & 2 deletions integrationtests/self/early_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package self_test
import (
"context"
"fmt"
"io/ioutil"
"io"
"net"
"time"

Expand Down Expand Up @@ -61,7 +61,7 @@ var _ = Describe("early data", func() {
Expect(err).ToNot(HaveOccurred())
str, err := sess.AcceptUniStream(context.Background())
Expect(err).ToNot(HaveOccurred())
data, err := ioutil.ReadAll(str)
data, err := io.ReadAll(str)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal([]byte("early data")))
sess.CloseWithError(0, "")
Expand Down
6 changes: 3 additions & 3 deletions integrationtests/self/handshake_drop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"crypto/tls"
"fmt"
"io/ioutil"
"io"
mrand "math/rand"
"net"
"sync/atomic"
Expand Down Expand Up @@ -79,7 +79,7 @@ var _ = Describe("Handshake drop tests", func() {
defer sess.CloseWithError(0, "")
str, err := sess.AcceptStream(context.Background())
Expect(err).ToNot(HaveOccurred())
b, err := ioutil.ReadAll(gbytes.TimeoutReader(str, timeout))
b, err := io.ReadAll(gbytes.TimeoutReader(str, timeout))
Expect(err).ToNot(HaveOccurred())
Expect(b).To(Equal(data))
serverSessionChan <- sess
Expand Down Expand Up @@ -134,7 +134,7 @@ var _ = Describe("Handshake drop tests", func() {
Expect(err).ToNot(HaveOccurred())
str, err := sess.AcceptStream(context.Background())
Expect(err).ToNot(HaveOccurred())
b, err := ioutil.ReadAll(gbytes.TimeoutReader(str, timeout))
b, err := io.ReadAll(gbytes.TimeoutReader(str, timeout))
Expect(err).ToNot(HaveOccurred())
Expect(b).To(Equal(data))

Expand Down
4 changes: 2 additions & 2 deletions integrationtests/self/handshake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"io"
"net"
"time"

Expand Down Expand Up @@ -216,7 +216,7 @@ var _ = Describe("Handshake tests", func() {
Expect(err).ToNot(HaveOccurred())
str, err := sess.AcceptStream(context.Background())
Expect(err).ToNot(HaveOccurred())
data, err := ioutil.ReadAll(str)
data, err := io.ReadAll(str)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal(PRData))
Expect(sess.ConnectionState().TLS.CipherSuite).To(Equal(suiteID))
Expand Down
17 changes: 8 additions & 9 deletions integrationtests/self/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"strconv"
Expand Down Expand Up @@ -63,7 +62,7 @@ var _ = Describe("HTTP tests", func() {

mux.HandleFunc("/echo", func(w http.ResponseWriter, r *http.Request) {
defer GinkgoRecover()
body, err := ioutil.ReadAll(r.Body)
body, err := io.ReadAll(r.Body)
Expect(err).NotTo(HaveOccurred())
w.Write(body) // don't check the error here. Stream may be reset.
})
Expand Down Expand Up @@ -119,7 +118,7 @@ var _ = Describe("HTTP tests", func() {
resp, err := client.Get("https://localhost:" + port + "/hello")
Expect(err).ToNot(HaveOccurred())
Expect(resp.StatusCode).To(Equal(200))
body, err := ioutil.ReadAll(gbytes.TimeoutReader(resp.Body, 3*time.Second))
body, err := io.ReadAll(gbytes.TimeoutReader(resp.Body, 3*time.Second))
Expect(err).ToNot(HaveOccurred())
Expect(string(body)).To(Equal("Hello, World!\n"))
})
Expand Down Expand Up @@ -161,7 +160,7 @@ var _ = Describe("HTTP tests", func() {
resp, err := client.Get("https://localhost:" + port + "/prdata")
Expect(err).ToNot(HaveOccurred())
Expect(resp.StatusCode).To(Equal(200))
body, err := ioutil.ReadAll(gbytes.TimeoutReader(resp.Body, 5*time.Second))
body, err := io.ReadAll(gbytes.TimeoutReader(resp.Body, 5*time.Second))
Expect(err).ToNot(HaveOccurred())
Expect(body).To(Equal(PRData))
})
Expand All @@ -170,7 +169,7 @@ var _ = Describe("HTTP tests", func() {
resp, err := client.Get("https://localhost:" + port + "/prdatalong")
Expect(err).ToNot(HaveOccurred())
Expect(resp.StatusCode).To(Equal(200))
body, err := ioutil.ReadAll(gbytes.TimeoutReader(resp.Body, 20*time.Second))
body, err := io.ReadAll(gbytes.TimeoutReader(resp.Body, 20*time.Second))
Expect(err).ToNot(HaveOccurred())
Expect(body).To(Equal(PRDataLong))
})
Expand All @@ -182,7 +181,7 @@ var _ = Describe("HTTP tests", func() {
resp, err := client.Get("https://localhost:" + port + "/hello")
Expect(err).ToNot(HaveOccurred())
Expect(resp.StatusCode).To(Equal(200))
body, err := ioutil.ReadAll(gbytes.TimeoutReader(resp.Body, 3*time.Second))
body, err := io.ReadAll(gbytes.TimeoutReader(resp.Body, 3*time.Second))
Expect(err).ToNot(HaveOccurred())
Expect(string(body)).To(Equal("Hello, World!\n"))
}
Expand All @@ -207,7 +206,7 @@ var _ = Describe("HTTP tests", func() {
)
Expect(err).ToNot(HaveOccurred())
Expect(resp.StatusCode).To(Equal(200))
body, err := ioutil.ReadAll(gbytes.TimeoutReader(resp.Body, 5*time.Second))
body, err := io.ReadAll(gbytes.TimeoutReader(resp.Body, 5*time.Second))
Expect(err).ToNot(HaveOccurred())
Expect(body).To(Equal([]byte("Hello, world!")))
})
Expand All @@ -220,7 +219,7 @@ var _ = Describe("HTTP tests", func() {
)
Expect(err).ToNot(HaveOccurred())
Expect(resp.StatusCode).To(Equal(200))
body, err := ioutil.ReadAll(gbytes.TimeoutReader(resp.Body, 5*time.Second))
body, err := io.ReadAll(gbytes.TimeoutReader(resp.Body, 5*time.Second))
Expect(err).ToNot(HaveOccurred())
Expect(body).To(Equal(PRData))
})
Expand All @@ -243,7 +242,7 @@ var _ = Describe("HTTP tests", func() {
Expect(resp.StatusCode).To(Equal(200))
Expect(resp.Uncompressed).To(BeTrue())

body, err := ioutil.ReadAll(gbytes.TimeoutReader(resp.Body, 3*time.Second))
body, err := io.ReadAll(gbytes.TimeoutReader(resp.Body, 3*time.Second))
Expect(err).ToNot(HaveOccurred())
Expect(string(body)).To(Equal("Hello, World!\n"))
})
Expand Down
4 changes: 2 additions & 2 deletions integrationtests/self/key_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package self_test
import (
"context"
"fmt"
"io/ioutil"
"io"
"net"

quic "github.com/lucas-clemente/quic-go"
Expand Down Expand Up @@ -90,7 +90,7 @@ var _ = Describe("Key Update tests", func() {
Expect(err).ToNot(HaveOccurred())
str, err := sess.AcceptUniStream(context.Background())
Expect(err).ToNot(HaveOccurred())
data, err := ioutil.ReadAll(str)
data, err := io.ReadAll(str)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal(PRDataLong))
Expect(sess.CloseWithError(0, "")).To(Succeed())
Expand Down
Loading

0 comments on commit 8ecbb05

Please sign in to comment.