Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit16e7a5d

Browse files
removes unused code
1 parent62d5a15 commit16e7a5d

File tree

1 file changed

+2
-91
lines changed

1 file changed

+2
-91
lines changed

‎pkg/github/projects.go‎

Lines changed: 2 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ import (
66
"fmt"
77
"io"
88
"net/http"
9-
"net/url"
10-
"reflect"
119
"strings"
1210

1311
ghErrors"github.com/github/github-mcp-server/pkg/errors"
1412
"github.com/github/github-mcp-server/pkg/translations"
1513
"github.com/google/go-github/v79/github"
16-
"github.com/google/go-querystring/query"
1714
"github.com/mark3labs/mcp-go/mcp"
1815
"github.com/mark3labs/mcp-go/server"
1916
)
@@ -542,8 +539,8 @@ func GetProjectItem(getClient GetClientFn, t translations.TranslationHelperFunc)
542539
returnmcp.NewToolResultError(err.Error()),nil
543540
}
544541

545-
resp:=&github.Response{}
546-
projectItem:=&github.ProjectV2Item{}
542+
varresp*github.Response
543+
varprojectItem*github.ProjectV2Item
547544
varopts*github.GetProjectItemOptions
548545

549546
iflen(fields)>0 {
@@ -846,67 +843,13 @@ func DeleteProjectItem(getClient GetClientFn, t translations.TranslationHelperFu
846843
}
847844
}
848845

849-
typefieldSelectionOptionsstruct {
850-
// Specific list of field IDs to include in the response. If not provided, only the title field is included.
851-
// The comma tag encodes the slice as comma-separated values: fields=102589,985201,169875
852-
Fields []int64`url:"fields,omitempty,comma"`
853-
}
854-
855-
typeprojectV2ItemFieldValuestruct {
856-
ID*int64`json:"id,omitempty"`
857-
Namestring`json:"name,omitempty"`
858-
DataTypestring`json:"data_type,omitempty"`
859-
Valueany`json:"value,omitempty"`
860-
}
861-
862-
typeprojectV2Itemstruct {
863-
ArchivedAt*github.Timestamp`json:"archived_at,omitempty"`
864-
Content*projectV2ItemContent`json:"content,omitempty"`
865-
ContentType*string`json:"content_type,omitempty"`
866-
CreatedAt*github.Timestamp`json:"created_at,omitempty"`
867-
Creator*github.User`json:"creator,omitempty"`
868-
Description*string`json:"description,omitempty"`
869-
Fields []*projectV2ItemFieldValue`json:"fields,omitempty"`
870-
ID*int64`json:"id,omitempty"`
871-
ItemURL*string`json:"item_url,omitempty"`
872-
NodeID*string`json:"node_id,omitempty"`
873-
ProjectURL*string`json:"project_url,omitempty"`
874-
Title*string`json:"title,omitempty"`
875-
UpdatedAt*github.Timestamp`json:"updated_at,omitempty"`
876-
}
877-
878-
typeprojectV2ItemContentstruct {
879-
Body*string`json:"body,omitempty"`
880-
ClosedAt*github.Timestamp`json:"closed_at,omitempty"`
881-
CreatedAt*github.Timestamp`json:"created_at,omitempty"`
882-
ID*int64`json:"id,omitempty"`
883-
Number*int`json:"number,omitempty"`
884-
State*string`json:"state,omitempty"`
885-
StateReason*string`json:"stateReason,omitempty"`
886-
Title*string`json:"title,omitempty"`
887-
UpdatedAt*github.Timestamp`json:"updated_at,omitempty"`
888-
URL*string`json:"url,omitempty"`
889-
}
890-
891846
typepageInfostruct {
892847
HasNextPagebool`json:"hasNextPage"`
893848
HasPreviousPagebool`json:"hasPreviousPage"`
894849
NextCursorstring`json:"nextCursor,omitempty"`
895850
PrevCursorstring`json:"prevCursor,omitempty"`
896851
}
897852

898-
typeprojectV2Fieldstruct {
899-
ID*int64`json:"id,omitempty"`
900-
NodeID*string`json:"node_id,omitempty"`
901-
Name*string`json:"name,omitempty"`
902-
DataType*string`json:"data_type,omitempty"`
903-
ProjectURL*string`json:"project_url,omitempty"`
904-
Options []any`json:"options,omitempty"`
905-
Configurationany`json:"configuration,omitempty"`
906-
CreatedAt*github.Timestamp`json:"created_at,omitempty"`
907-
UpdatedAt*github.Timestamp`json:"updated_at,omitempty"`
908-
}
909-
910853
functoNewProjectType(projTypestring)string {
911854
switchstrings.ToLower(projType) {
912855
case"issue":
@@ -990,35 +933,3 @@ func extractPaginationOptions(request mcp.CallToolRequest) (github.ListProjectsP
990933

991934
returnopts,nil
992935
}
993-
994-
// addOptions adds the parameters in opts as URL query parameters to s. opts
995-
// must be a struct whose fields may contain "url" tags.
996-
funcaddOptions(sstring,optsany) (string,error) {
997-
v:=reflect.ValueOf(opts)
998-
ifv.Kind()==reflect.Ptr&&v.IsNil() {
999-
returns,nil
1000-
}
1001-
1002-
origURL,err:=url.Parse(s)
1003-
iferr!=nil {
1004-
returns,err
1005-
}
1006-
1007-
origValues:=origURL.Query()
1008-
1009-
// Use the github.com/google/go-querystring library to parse the struct
1010-
newValues,err:=query.Values(opts)
1011-
iferr!=nil {
1012-
returns,err
1013-
}
1014-
1015-
// Merge the values
1016-
forkey,values:=rangenewValues {
1017-
for_,value:=rangevalues {
1018-
origValues.Add(key,value)
1019-
}
1020-
}
1021-
1022-
origURL.RawQuery=origValues.Encode()
1023-
returnorigURL.String(),nil
1024-
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp