run gofumpt, enable the gofumpt linter

This commit is contained in:
Marten Seemann
2020-10-25 12:43:26 +07:00
parent 598f975024
commit 8752576f26
50 changed files with 132 additions and 109 deletions

View File

@@ -137,8 +137,10 @@ type cryptoSetup struct {
has1RTTOpener bool
}
var _ qtls.RecordLayer = &cryptoSetup{}
var _ CryptoSetup = &cryptoSetup{}
var (
_ qtls.RecordLayer = &cryptoSetup{}
_ CryptoSetup = &cryptoSetup{}
)
// NewCryptoSetupClient creates a new crypto setup for the client
func NewCryptoSetupClient(

View File

@@ -4,6 +4,7 @@ import (
"crypto/tls"
"encoding/hex"
"strings"
"testing"
"github.com/lucas-clemente/quic-go/internal/qtls"
@@ -11,8 +12,6 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)
func TestHandshake(t *testing.T) {

View File

@@ -26,7 +26,6 @@ func newHeaderProtector(suite *qtls.CipherSuiteTLS13, trafficSecret []byte, isLo
default:
panic(fmt.Sprintf("Invalid cipher suite id: %d", suite.ID))
}
}
type aesHeaderProtector struct {

View File

@@ -13,7 +13,7 @@ import (
var retryAEAD cipher.AEAD
func init() {
var key = [16]byte{0xcc, 0xce, 0x18, 0x7e, 0xd0, 0x9a, 0x09, 0xd0, 0x57, 0x28, 0x15, 0x5a, 0x6c, 0xb9, 0x6b, 0xe1}
key := [16]byte{0xcc, 0xce, 0x18, 0x7e, 0xd0, 0x9a, 0x09, 0xd0, 0x57, 0x28, 0x15, 0x5a, 0x6c, 0xb9, 0x6b, 0xe1}
aes, err := aes.NewCipher(key[:])
if err != nil {
@@ -26,9 +26,11 @@ func init() {
retryAEAD = aead
}
var retryBuf bytes.Buffer
var retryMutex sync.Mutex
var retryNonce = [12]byte{0xe5, 0x49, 0x30, 0xf9, 0x7f, 0x21, 0x36, 0xf0, 0x53, 0x0a, 0x8c, 0x1c}
var (
retryBuf bytes.Buffer
retryMutex sync.Mutex
retryNonce = [12]byte{0xe5, 0x49, 0x30, 0xf9, 0x7f, 0x21, 0x36, 0xf0, 0x53, 0x0a, 0x8c, 0x1c}
)
// GetRetryIntegrityTag calculates the integrity tag on a Retry packet
func GetRetryIntegrityTag(retry []byte, origDestConnID protocol.ConnectionID) *[16]byte {

View File

@@ -61,8 +61,10 @@ type updatableAEAD struct {
nonceBuf []byte
}
var _ ShortHeaderOpener = &updatableAEAD{}
var _ ShortHeaderSealer = &updatableAEAD{}
var (
_ ShortHeaderOpener = &updatableAEAD{}
_ ShortHeaderSealer = &updatableAEAD{}
)
func newUpdatableAEAD(rttStats *utils.RTTStats, tracer logging.ConnectionTracer, logger utils.Logger) *updatableAEAD {
return &updatableAEAD{