mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 12:04:03 +03:00
Formatting with gofumpt
This commit is contained in:
@@ -13,8 +13,7 @@ import (
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
type SimpleNetwork struct {
|
||||
}
|
||||
type SimpleNetwork struct{}
|
||||
|
||||
func (s SimpleNetwork) Dial(network, address string) (essentials.Conn, error) {
|
||||
return s.DialContext(context.Background(), network, address)
|
||||
|
||||
@@ -22,10 +22,8 @@ const (
|
||||
TypeApplicationData = 0x17
|
||||
)
|
||||
|
||||
var (
|
||||
// TLS 1.2 is used for both TLS 1.2 and 1.3
|
||||
TLSVersion = [SizeVersion]byte{3, 3}
|
||||
)
|
||||
var TLSVersion = [SizeVersion]byte{3, 3}
|
||||
|
||||
// Conn presents an established TLS 1.3 connection, after handshake
|
||||
type Conn struct {
|
||||
|
||||
@@ -5,13 +5,11 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
var (
|
||||
bytesPool = sync.Pool{
|
||||
var bytesPool = sync.Pool{
|
||||
New: func() any {
|
||||
return &bytes.Buffer{}
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
func acquireBuffer() *bytes.Buffer {
|
||||
return bytesPool.Get().(*bytes.Buffer)
|
||||
|
||||
@@ -45,5 +45,4 @@ func FuzzReadClientHello(f *testing.F) {
|
||||
_, err := fake.ReadClientHello(r, secret.Key[:], secret.Host, time.Hour)
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -20,8 +20,7 @@ const (
|
||||
EllipticCurveLen = 32
|
||||
)
|
||||
|
||||
var (
|
||||
serverHelloSuffix = []byte{
|
||||
var serverHelloSuffix = []byte{
|
||||
0x00, // no compression
|
||||
0x00, 0x2e, // 46 bytes of data
|
||||
0x00, 0x2b, // Extension - Supported Versions
|
||||
@@ -32,7 +31,6 @@ var (
|
||||
0x00, 0x1d, // x25519 curve
|
||||
0x00, 0x20, // 32 bytes of key
|
||||
}
|
||||
)
|
||||
|
||||
func SendServerHello(w io.Writer, secret []byte, clientHello *ClientHello) ([]byte, error) {
|
||||
buf := &bytes.Buffer{}
|
||||
|
||||
Reference in New Issue
Block a user