Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/docker/go-connections

go 1.18
go 1.23

require (
github.com/Microsoft/go-winio v0.4.21
Expand Down
2 changes: 1 addition & 1 deletion nat/nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func ParsePortSpec(rawPort string) ([]PortMapping, error) {
count := endPort - startPort + 1
ports := make([]PortMapping, 0, count)

for i := 0; i < count; i++ {
for i := range count {
hPort := ""
if hostPort != "" {
hPort = strconv.Itoa(startHostPort + i)
Expand Down
1 change: 0 additions & 1 deletion nat/sort.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ func SortPortMap(ports []Port, bindings map[Port][]PortBinding) {
portInt, portProto := p.Int(), p.Proto()
if binding, ok := bindings[p]; ok && len(binding) > 0 {
for _, b := range binding {
b := b // capture loop variable for go < 1.22
s = append(s, portMapEntry{
port: p, binding: &b,
portInt: portInt, portProto: portProto,
Expand Down
2 changes: 1 addition & 1 deletion nat/sort_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func BenchmarkSortPortMap(b *testing.B) {
ports := make([]Port, 0, n*2)
portMap := make(map[Port][]PortBinding, n*2)

for i := 0; i < n; i++ {
for i := range n {
portNum := 30000 + (i % 50) // force duplicate port numbers
tcp := Port(fmt.Sprintf("%d/tcp", portNum))
udp := Port(fmt.Sprintf("%d/udp", portNum))
Expand Down
4 changes: 2 additions & 2 deletions proxy/logger.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package proxy

type logger interface {
Printf(format string, args ...interface{})
Printf(format string, args ...any)
}

type noopLogger struct{}

func (l *noopLogger) Printf(_ string, _ ...interface{}) {
func (l *noopLogger) Printf(_ string, _ ...any) {
// Do nothing :)
}
4 changes: 2 additions & 2 deletions tlsconfig/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestConfigServerTLSFailsIfUnableToLoadCerts(t *testing.T) {
_ = tempFile.Close()

for _, badFile := range []string{"not-a-file", tempFile.Name()} {
for i := 0; i < 3; i++ {
for i := range 3 {
files := []string{cert, key, ca}
files[i] = badFile

Expand Down Expand Up @@ -475,7 +475,7 @@ func TestConfigClientTLSClientCertOrKeyInvalid(t *testing.T) {
defer func() { _ = os.Remove(tempFile.Name()) }()
_ = tempFile.Close()

for i := 0; i < 2; i++ {
for i := range 2 {
for _, invalid := range []string{"not-a-file", "", tempFile.Name()} {
files := []string{cert, key}
files[i] = invalid
Expand Down
Loading