Skip to content

Commit 4759952

Browse files
authored
Merge pull request #200 from o-ga09/go-fix
chore: Go fix
2 parents b14afcd + 0361701 commit 4759952

6 files changed

Lines changed: 31 additions & 28 deletions

File tree

.github/workflows/terraform.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
paths:
66
- "terraform/**"
77
- ".github/workflows/terraform.yml"
8+
push:
9+
tags:
10+
- "v*"
811
workflow_dispatch:
912
env:
1013
GCP_PROJECT_NUMBER: ${{ secrets.GCP_PROJECT_NUMBER }}

cmd/mcp/main.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,26 +84,26 @@ func (m *MCPServer) AddTools() []server.ServerTool {
8484
Description: "Get a list of all monsters with their details",
8585
InputSchema: mcp.ToolInputSchema{
8686
Type: "object",
87-
Properties: map[string]interface{}{
88-
"monster_ids": map[string]interface{}{
87+
Properties: map[string]any{
88+
"monster_ids": map[string]any{
8989
"type": "string",
9090
"description": "Filter by monster ID (optional, can be a comma-separated list of IDs)",
9191
},
92-
"name": map[string]interface{}{
92+
"name": map[string]any{
9393
"type": "string",
9494
"description": "Filter by monster name (optional, supports partial matches)",
9595
},
96-
"sort": map[string]interface{}{
96+
"sort": map[string]any{
9797
"type": "string",
9898
"description": "Sort order for the results (optional, 'asc' for ascending, 'desc' for descending, default is 'asc')",
9999
"enum": []string{"asc", "desc"},
100100
},
101-
"offset": map[string]interface{}{
101+
"offset": map[string]any{
102102
"type": "integer",
103103
"description": "Offset for pagination (optional, default: 0)",
104104
"minimum": 0,
105105
},
106-
"limit": map[string]interface{}{
106+
"limit": map[string]any{
107107
"type": "integer",
108108
"description": "Number of items per page (optional, default: 50)",
109109
"minimum": 1,
@@ -120,8 +120,8 @@ func (m *MCPServer) AddTools() []server.ServerTool {
120120
Description: "Get detailed information about a specific monster by ID",
121121
InputSchema: mcp.ToolInputSchema{
122122
Type: "object",
123-
Properties: map[string]interface{}{
124-
"monster_id": map[string]interface{}{
123+
Properties: map[string]any{
124+
"monster_id": map[string]any{
125125
"type": "string",
126126
"description": "The unique identifier of the monster",
127127
},
@@ -137,22 +137,22 @@ func (m *MCPServer) AddTools() []server.ServerTool {
137137
Description: "Search weapons with various filters",
138138
InputSchema: mcp.ToolInputSchema{
139139
Type: "object",
140-
Properties: map[string]interface{}{
141-
"weapon_id": map[string]interface{}{
140+
Properties: map[string]any{
141+
"weapon_id": map[string]any{
142142
"type": "string",
143143
"description": "Filter by weapon ID (optional)",
144144
},
145-
"name": map[string]interface{}{
145+
"name": map[string]any{
146146
"type": "string",
147147
"description": "Filter by weapon name (optional)",
148148
},
149-
"limit": map[string]interface{}{
149+
"limit": map[string]any{
150150
"type": "integer",
151151
"description": "Number of items to return (optional, default: 50)",
152152
"minimum": 1,
153153
"maximum": 100,
154154
},
155-
"offset": map[string]interface{}{
155+
"offset": map[string]any{
156156
"type": "integer",
157157
"description": "Number of items to skip (optional, default: 0)",
158158
"minimum": 0,
@@ -168,7 +168,7 @@ func (m *MCPServer) AddTools() []server.ServerTool {
168168
Description: "Get a list of all items",
169169
InputSchema: mcp.ToolInputSchema{
170170
Type: "object",
171-
Properties: map[string]interface{}{},
171+
Properties: map[string]any{},
172172
},
173173
},
174174
Handler: m.getItems,
@@ -180,8 +180,8 @@ func (m *MCPServer) AddTools() []server.ServerTool {
180180
Description: "Get detailed information about a specific item by ID",
181181
InputSchema: mcp.ToolInputSchema{
182182
Type: "object",
183-
Properties: map[string]interface{}{
184-
"item_id": map[string]interface{}{
183+
Properties: map[string]any{
184+
"item_id": map[string]any{
185185
"type": "string",
186186
"description": "The unique identifier of the item",
187187
},
@@ -197,8 +197,8 @@ func (m *MCPServer) AddTools() []server.ServerTool {
197197
Description: "Get items that can be obtained from a specific monster",
198198
InputSchema: mcp.ToolInputSchema{
199199
Type: "object",
200-
Properties: map[string]interface{}{
201-
"monster_id": map[string]interface{}{
200+
Properties: map[string]any{
201+
"monster_id": map[string]any{
202202
"type": "string",
203203
"description": "The unique identifier of the monster",
204204
},
@@ -214,7 +214,7 @@ func (m *MCPServer) AddTools() []server.ServerTool {
214214
Description: "Get a list of all skills with their level details",
215215
InputSchema: mcp.ToolInputSchema{
216216
Type: "object",
217-
Properties: map[string]interface{}{},
217+
Properties: map[string]any{},
218218
},
219219
},
220220
Handler: m.getSkills,
@@ -225,8 +225,8 @@ func (m *MCPServer) AddTools() []server.ServerTool {
225225
Description: "Get detailed information about a specific skill by ID",
226226
InputSchema: mcp.ToolInputSchema{
227227
Type: "object",
228-
Properties: map[string]interface{}{
229-
"skill_id": map[string]interface{}{
228+
Properties: map[string]any{
229+
"skill_id": map[string]any{
230230
"type": "string",
231231
"description": "The unique identifier of the skill",
232232
},

internal/database/mysql/db_connect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func New(ctx context.Context) context.Context {
6060

6161
func connect(ctx context.Context, dialector gorm.Dialector) context.Context {
6262
var err error
63-
for i := 0; i < MAX_RETRY; i++ {
63+
for i := range MAX_RETRY {
6464
if db, err = gorm.Open(dialector, &gorm.Config{
6565
NamingStrategy: schema.NamingStrategy{
6666
SingularTable: false,

internal/database/mysql/sentry.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ func (l *SentryLogger) LogMode(level logger.LogLevel) logger.Interface {
3131
return &newlogger
3232
}
3333

34-
func (l *SentryLogger) Info(ctx context.Context, msg string, data ...interface{}) {
34+
func (l *SentryLogger) Info(ctx context.Context, msg string, data ...any) {
3535
if l.logLevel >= logger.Info {
3636
slog.Log(ctx, constant.SeverityInfo, fmt.Sprintf(msg, data...))
3737
}
3838
}
3939

40-
func (l *SentryLogger) Warn(ctx context.Context, msg string, data ...interface{}) {
40+
func (l *SentryLogger) Warn(ctx context.Context, msg string, data ...any) {
4141
if l.logLevel >= logger.Warn {
4242
slog.Log(ctx, constant.SeverityWarn, fmt.Sprintf(msg, data...))
4343
}
4444
}
4545

46-
func (l *SentryLogger) Error(ctx context.Context, msg string, data ...interface{}) {
46+
func (l *SentryLogger) Error(ctx context.Context, msg string, data ...any) {
4747
if l.logLevel >= logger.Error {
4848
slog.Log(ctx, constant.SeverityError, fmt.Sprintf(msg, data...))
4949
}

internal/database/mysql/testHelper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ func migrationTestData() {
7070
log.Fatal(err)
7171
}
7272
// テーブルのクリーンアップ
73-
statements := strings.Split(string(truncateSQL), ";")
73+
statements := strings.SplitSeq(string(truncateSQL), ";")
7474
// テーブルのクリーンアップ
75-
for _, stmt := range statements {
75+
for stmt := range statements {
7676
// 空の文を除外
7777
if strings.TrimSpace(stmt) != "" {
7878
if err := testDB.Exec(stmt).Error; err != nil {

pkg/testutil/golden.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func AssertGoldenJSON(t *testing.T, goldenFile string, actual []byte) {
3030
require.NoError(t, err)
3131

3232
// JSON形式に整形して比較
33-
var expectedJSON, actualJSON interface{}
33+
var expectedJSON, actualJSON any
3434
err = json.Unmarshal(expected, &expectedJSON)
3535
require.NoError(t, err)
3636

0 commit comments

Comments
 (0)