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

@ -19,8 +19,10 @@ import (
// Note that 0-RTT data doesn't provide replay protection.
const MethodGet0RTT = "GET_0RTT"
const defaultUserAgent = "quic-go HTTP/3"
const defaultMaxResponseHeaderBytes = 10 * 1 << 20 // 10 MB
const (
defaultUserAgent = "quic-go HTTP/3"
defaultMaxResponseHeaderBytes = 10 * 1 << 20 // 10 MB
)
var defaultQuicConfig = &quic.Config{
MaxIncomingStreams: -1, // don't allow the server to create bidirectional streams

View file

@ -22,8 +22,10 @@ type responseWriter struct {
logger utils.Logger
}
var _ http.ResponseWriter = &responseWriter{}
var _ http.Flusher = &responseWriter{}
var (
_ http.ResponseWriter = &responseWriter{}
_ http.Flusher = &responseWriter{}
)
func newResponseWriter(stream io.Writer, logger utils.Logger) *responseWriter {
return &responseWriter{

View file

@ -23,6 +23,7 @@ type mockClient struct {
func (m *mockClient) RoundTrip(req *http.Request) (*http.Response, error) {
return &http.Response{Request: req}, nil
}
func (m *mockClient) Close() error {
m.closed = true
return nil

View file

@ -35,13 +35,11 @@ type contextKey struct {
func (k *contextKey) String() string { return "quic-go/http3 context value " + k.name }
var (
// ServerContextKey is a context key. It can be used in HTTP
// handlers with Context.Value to access the server that
// started the handler. The associated value will be of
// type *http3.Server.
ServerContextKey = &contextKey{"http3-server"}
)
// ServerContextKey is a context key. It can be used in HTTP
// handlers with Context.Value to access the server that
// started the handler. The associated value will be of
// type *http3.Server.
var ServerContextKey = &contextKey{"http3-server"}
type requestError struct {
err error