Skip to content

Commit 525f73b

Browse files
Fix linter issues in session info tests
- Replace deprecated gogithub.String/Int64 with gogithub.Ptr - Remove unused parameters from mock handler functions Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
1 parent b7243b8 commit 525f73b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

internal/ghmcp/server_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ func TestSessionInfoMiddleware_AddsMetadataToInitializeResult(t *testing.T) {
124124
mock.WithRequestMatch(
125125
mock.GetUser,
126126
gogithub.User{
127-
Login: gogithub.String("testuser"),
128-
ID: gogithub.Int64(12345),
129-
HTMLURL: gogithub.String("https://github.com/testuser"),
130-
AvatarURL: gogithub.String("https://avatars.githubusercontent.com/u/12345"),
131-
Name: gogithub.String("Test User"),
132-
Email: gogithub.String("test@example.com"),
133-
Bio: gogithub.String("Test bio"),
134-
Company: gogithub.String("Test Company"),
135-
Location: gogithub.String("Test Location"),
127+
Login: gogithub.Ptr("testuser"),
128+
ID: gogithub.Ptr(int64(12345)),
129+
HTMLURL: gogithub.Ptr("https://github.com/testuser"),
130+
AvatarURL: gogithub.Ptr("https://avatars.githubusercontent.com/u/12345"),
131+
Name: gogithub.Ptr("Test User"),
132+
Email: gogithub.Ptr("test@example.com"),
133+
Bio: gogithub.Ptr("Test bio"),
134+
Company: gogithub.Ptr("Test Company"),
135+
Location: gogithub.Ptr("Test Location"),
136136
},
137137
),
138138
)
@@ -143,7 +143,7 @@ func TestSessionInfoMiddleware_AddsMetadataToInitializeResult(t *testing.T) {
143143
middleware := addSessionInfoMiddleware(tc.cfg, restClient, tc.enabledToolsets, tc.instructionToolsets)
144144

145145
// Create a mock handler that returns a valid InitializeResult
146-
mockHandler := func(ctx context.Context, method string, req mcp.Request) (mcp.Result, error) {
146+
mockHandler := func(_ context.Context, _ string, _ mcp.Request) (mcp.Result, error) {
147147
return &mcp.InitializeResult{
148148
ProtocolVersion: "2024-11-05",
149149
Capabilities: &mcp.ServerCapabilities{},
@@ -234,7 +234,7 @@ func TestSessionInfoMiddleware_OmitsUserOnAPIFailure(t *testing.T) {
234234
middleware := addSessionInfoMiddleware(cfg, restClient, []string{"context"}, []string{"context"})
235235

236236
// Create a mock handler
237-
mockHandler := func(ctx context.Context, method string, req mcp.Request) (mcp.Result, error) {
237+
mockHandler := func(_ context.Context, _ string, _ mcp.Request) (mcp.Result, error) {
238238
return &mcp.InitializeResult{
239239
ProtocolVersion: "2024-11-05",
240240
Capabilities: &mcp.ServerCapabilities{},
@@ -292,7 +292,7 @@ func TestUnauthenticatedSessionInfoMiddleware(t *testing.T) {
292292
middleware := addUnauthenticatedSessionInfoMiddleware(cfg, []string{}, []string{})
293293

294294
// Create a mock handler
295-
mockHandler := func(ctx context.Context, method string, req mcp.Request) (mcp.Result, error) {
295+
mockHandler := func(_ context.Context, _ string, _ mcp.Request) (mcp.Result, error) {
296296
return &mcp.InitializeResult{
297297
ProtocolVersion: "2024-11-05",
298298
Capabilities: &mcp.ServerCapabilities{},

0 commit comments

Comments
 (0)