Commit de1af30e authored by Michal Witkowski's avatar Michal Witkowski

gofmt and spellcheck

parent bc477b5d
......@@ -8,9 +8,7 @@ import (
"fmt"
)
// TlsConfigForCerts is a returns a simple `tls.Config` with the given server cert loaded.
// TlsConfigForServerCerts is a returns a simple `tls.Config` with the given server cert loaded.
// This is useful if you can't use `http.ListenAndServerTLS` when using a custom `net.Listener`.
func TlsConfigForServerCerts(certFile string, keyFile string) (*tls.Config, error) {
var err error
......@@ -59,4 +57,4 @@ func TlsConfigWithHttp2Enabled(config *tls.Config) (*tls.Config, error) {
// make sure http 1.1 is *after* all of the other ones.
config.NextProtos = append(config.NextProtos, "http/1.1")
return config, nil
}
\ No newline at end of file
}
......@@ -84,7 +84,7 @@ func (s *DialerTestSuite) TestDialerMetricsAreNotPreregisteredWithMonitoringOff(
{"net_conntrack_dialer_conn_failed_total", []string{"nomon", "unknown"}},
} {
lineCount := len(fetchPrometheusLines(s.T(), testCase.metricName, testCase.existingLabels...))
assert.Equal(s.T(), 0, lineCount, "metrics shoudl not be registered exist for test case %d", testId)
assert.Equal(s.T(), 0, lineCount, "metrics should not be registered exist for test case %d", testId)
}
}
......
......@@ -71,7 +71,7 @@ func DialNameToContext(ctx context.Context, dialerName string) context.Context {
// NewDialContextFunc returns a `DialContext` function that tracks outbound connections.
// The signature is compatible with `http.Tranport.DialContext` and is meant to be used there.
func NewDialContextFunc(optFuncs ...dialerOpt) (func(context.Context, string, string) (net.Conn, error)) {
func NewDialContextFunc(optFuncs ...dialerOpt) func(context.Context, string, string) (net.Conn, error) {
opts := &dialerOpts{name: defaultName, monitoring: true, parentDialer: &net.Dialer{}}
for _, f := range optFuncs {
f(opts)
......@@ -90,7 +90,7 @@ func NewDialContextFunc(optFuncs ...dialerOpt) (func(context.Context, string, st
// NewDialFunc returns a `Dial` function that tracks outbound connections.
// The signature is compatible with `http.Tranport.Dial` and is meant to be used there for Go < 1.7.
func NewDialFunc(optFuncs ...dialerOpt) (func(string, string) (net.Conn, error)) {
func NewDialFunc(optFuncs ...dialerOpt) func(string, string) (net.Conn, error) {
dialContextFunc := NewDialContextFunc(optFuncs...)
return func(network string, addr string) (net.Conn, error) {
return dialContextFunc(context.TODO(), network, addr)
......
......@@ -14,11 +14,11 @@ import (
"time"
"github.com/mwitkow/go-conntrack"
"github.com/mwitkow/go-conntrack/connhelpers"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/net/context/ctxhttp"
_ "golang.org/x/net/trace"
"github.com/mwitkow/go-conntrack"
"github.com/mwitkow/go-conntrack/connhelpers"
)
var (
......
......@@ -18,9 +18,9 @@ const (
)
type listenerOpts struct {
name string
monitoring bool
tracing bool
name string
monitoring bool
tracing bool
tcpKeepAlive time.Duration
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment