Skip to content

Commit e15eabd

Browse files
committed
format and lint
1 parent 56ea66f commit e15eabd

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

cmd/docker-mcp/internal/gateway/capabilitites.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import (
44
"context"
55
"fmt"
66
"runtime"
7+
"slices"
78
"strings"
89
"sync"
910

10-
"slices"
11-
1211
"github.com/mark3labs/mcp-go/mcp"
1312
"github.com/mark3labs/mcp-go/server"
1413
"golang.org/x/sync/errgroup"

cmd/docker-mcp/tools/enable.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ import (
44
"bytes"
55
"context"
66
"fmt"
7+
"slices"
78
"sort"
89

910
"gopkg.in/yaml.v3"
1011

11-
"slices"
12-
1312
"github.com/docker/mcp-gateway/cmd/docker-mcp/internal/catalog"
1413
"github.com/docker/mcp-gateway/cmd/docker-mcp/internal/config"
1514
"github.com/docker/mcp-gateway/cmd/docker-mcp/internal/docker"

cmd/docker-mcp/tools/tools_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
func TestEnableToolsEmpty(t *testing.T) {
19-
ctx, _, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
19+
ctx, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
2020

2121
err := Enable(ctx, docker, []string{"search_duckduckgo"}, "duckduckgo")
2222
require.NoError(t, err)
@@ -30,7 +30,7 @@ func TestEnableToolsEmpty(t *testing.T) {
3030
}
3131

3232
func TestEnableToolsExistingServer(t *testing.T) {
33-
ctx, _, docker := setup(t,
33+
ctx, docker := setup(t,
3434
withToolsConfig("duckduckgo:\n - other_tool"),
3535
withSampleCatalog())
3636

@@ -47,7 +47,7 @@ func TestEnableToolsExistingServer(t *testing.T) {
4747
}
4848

4949
func TestEnableToolsExistingTool(t *testing.T) {
50-
ctx, _, docker := setup(t,
50+
ctx, docker := setup(t,
5151
withToolsConfig("duckduckgo:\n - other_tool"),
5252
withSampleCatalog())
5353

@@ -64,7 +64,7 @@ func TestEnableToolsExistingTool(t *testing.T) {
6464
}
6565

6666
func TestEnableToolsDuplicateTool(t *testing.T) {
67-
ctx, _, docker := setup(t,
67+
ctx, docker := setup(t,
6868
withEmptyToolsConfig(),
6969
withSampleCatalog())
7070

@@ -92,21 +92,21 @@ func TestEnableToolsDuplicateTool(t *testing.T) {
9292
}
9393

9494
func TestEnableToolNotFound(t *testing.T) {
95-
ctx, _, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
95+
ctx, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
9696

9797
err := Enable(ctx, docker, []string{"nonexistent_tool"}, "duckduckgo")
9898
require.ErrorContains(t, err, "tool \"nonexistent_tool\" not found in server \"duckduckgo\"")
9999
}
100100

101101
func TestEnableServerNotFound(t *testing.T) {
102-
ctx, _, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
102+
ctx, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
103103

104104
err := Enable(ctx, docker, []string{"nonexistent_tool"}, "nonexistent_server")
105105
require.ErrorContains(t, err, "server \"nonexistent_server\" not found in catalog")
106106
}
107107

108108
func TestEnableToolAutoDiscoverServer(t *testing.T) {
109-
ctx, _, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
109+
ctx, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
110110

111111
err := Enable(ctx, docker, []string{"search_duckduckgo"}, "")
112112
require.NoError(t, err)
@@ -120,7 +120,7 @@ func TestEnableToolAutoDiscoverServer(t *testing.T) {
120120
}
121121

122122
func TestEnableToolAutoDiscoverServerExistingServer(t *testing.T) {
123-
ctx, _, docker := setup(t, withToolsConfig("duckduckgo:\n - other_tool"), withSampleCatalog())
123+
ctx, docker := setup(t, withToolsConfig("duckduckgo:\n - other_tool"), withSampleCatalog())
124124

125125
err := Enable(ctx, docker, []string{"search_duckduckgo"}, "")
126126
require.NoError(t, err)
@@ -135,7 +135,7 @@ func TestEnableToolAutoDiscoverServerExistingServer(t *testing.T) {
135135
}
136136

137137
func TestEnableToolAutoDiscoverServerExistingTool(t *testing.T) {
138-
ctx, _, docker := setup(t,
138+
ctx, docker := setup(t,
139139
withToolsConfig("duckduckgo:\n - other_tool"),
140140
withSampleCatalog())
141141

@@ -152,14 +152,14 @@ func TestEnableToolAutoDiscoverServerExistingTool(t *testing.T) {
152152
}
153153

154154
func TestEnableToolAutoDiscoverNotFound(t *testing.T) {
155-
ctx, _, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
155+
ctx, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
156156

157157
err := Enable(ctx, docker, []string{"nonexistent_tool"}, "")
158158
require.ErrorContains(t, err, "tool \"nonexistent_tool\" not found in any server")
159159
}
160160

161161
func TestEnableMultipleTools(t *testing.T) {
162-
ctx, _, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
162+
ctx, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
163163

164164
err := Enable(ctx, docker, []string{"search_duckduckgo", "other_tool"}, "duckduckgo")
165165
require.NoError(t, err)
@@ -175,7 +175,7 @@ func TestEnableMultipleTools(t *testing.T) {
175175
}
176176

177177
func TestDisableEmpty(t *testing.T) {
178-
ctx, _, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
178+
ctx, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
179179

180180
err := Disable(ctx, docker, []string{"search_duckduckgo"}, "duckduckgo")
181181
require.NoError(t, err)
@@ -190,7 +190,7 @@ func TestDisableEmpty(t *testing.T) {
190190
}
191191

192192
func TestDisableToolExistingServer(t *testing.T) {
193-
ctx, _, docker := setup(t,
193+
ctx, docker := setup(t,
194194
withToolsConfig("duckduckgo:\n - search_duckduckgo\n - other_tool"),
195195
withSampleCatalog())
196196

@@ -207,7 +207,7 @@ func TestDisableToolExistingServer(t *testing.T) {
207207
}
208208

209209
func TestDisableToolExistingServerToolAlreadyDisabled(t *testing.T) {
210-
ctx, _, docker := setup(t,
210+
ctx, docker := setup(t,
211211
withToolsConfig("duckduckgo:\n - search_duckduckgo"),
212212
withSampleCatalog())
213213

@@ -224,14 +224,14 @@ func TestDisableToolExistingServerToolAlreadyDisabled(t *testing.T) {
224224
}
225225

226226
func TestDisableServerNotFound(t *testing.T) {
227-
ctx, _, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
227+
ctx, docker := setup(t, withEmptyToolsConfig(), withSampleCatalog())
228228

229229
err := Disable(ctx, docker, []string{"nonexistent_tool"}, "nonexistent_server")
230230
require.ErrorContains(t, err, "server \"nonexistent_server\" not found in catalog")
231231
}
232232

233233
func TestDisableMultipleTools(t *testing.T) {
234-
ctx, _, docker := setup(t,
234+
ctx, docker := setup(t,
235235
withToolsConfig("duckduckgo:\n - search_duckduckgo\n - other_tool"),
236236
withSampleCatalog())
237237

@@ -250,7 +250,7 @@ func TestDisableMultipleTools(t *testing.T) {
250250

251251
// Fixtures and helpers
252252

253-
func setup(t *testing.T, options ...option) (context.Context, string, docker.Client) {
253+
func setup(t *testing.T, options ...option) (context.Context, docker.Client) {
254254
t.Helper()
255255

256256
docker := &fakeDocker{}
@@ -266,7 +266,7 @@ func setup(t *testing.T, options ...option) (context.Context, string, docker.Cli
266266
o(t, home, docker)
267267
}
268268

269-
return t.Context(), home, docker
269+
return t.Context(), docker
270270
}
271271

272272
func writeFile(t *testing.T, path string, content []byte) {

0 commit comments

Comments
 (0)