diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 1988f9f8..6c02ed9f 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -5,6 +5,9 @@ on: paths: - "terraform/**" - ".github/workflows/terraform.yml" + push: + tags: + - "v*" workflow_dispatch: env: GCP_PROJECT_NUMBER: ${{ secrets.GCP_PROJECT_NUMBER }} diff --git a/cmd/mcp/main.go b/cmd/mcp/main.go index e2f71c22..952f04e5 100644 --- a/cmd/mcp/main.go +++ b/cmd/mcp/main.go @@ -84,26 +84,26 @@ func (m *MCPServer) AddTools() []server.ServerTool { Description: "Get a list of all monsters with their details", InputSchema: mcp.ToolInputSchema{ Type: "object", - Properties: map[string]interface{}{ - "monster_ids": map[string]interface{}{ + Properties: map[string]any{ + "monster_ids": map[string]any{ "type": "string", "description": "Filter by monster ID (optional, can be a comma-separated list of IDs)", }, - "name": map[string]interface{}{ + "name": map[string]any{ "type": "string", "description": "Filter by monster name (optional, supports partial matches)", }, - "sort": map[string]interface{}{ + "sort": map[string]any{ "type": "string", "description": "Sort order for the results (optional, 'asc' for ascending, 'desc' for descending, default is 'asc')", "enum": []string{"asc", "desc"}, }, - "offset": map[string]interface{}{ + "offset": map[string]any{ "type": "integer", "description": "Offset for pagination (optional, default: 0)", "minimum": 0, }, - "limit": map[string]interface{}{ + "limit": map[string]any{ "type": "integer", "description": "Number of items per page (optional, default: 50)", "minimum": 1, @@ -120,8 +120,8 @@ func (m *MCPServer) AddTools() []server.ServerTool { Description: "Get detailed information about a specific monster by ID", InputSchema: mcp.ToolInputSchema{ Type: "object", - Properties: map[string]interface{}{ - "monster_id": map[string]interface{}{ + Properties: map[string]any{ + "monster_id": map[string]any{ "type": "string", "description": "The unique identifier of the monster", }, @@ -137,22 +137,22 @@ func (m *MCPServer) AddTools() []server.ServerTool { Description: "Search weapons with various filters", InputSchema: mcp.ToolInputSchema{ Type: "object", - Properties: map[string]interface{}{ - "weapon_id": map[string]interface{}{ + Properties: map[string]any{ + "weapon_id": map[string]any{ "type": "string", "description": "Filter by weapon ID (optional)", }, - "name": map[string]interface{}{ + "name": map[string]any{ "type": "string", "description": "Filter by weapon name (optional)", }, - "limit": map[string]interface{}{ + "limit": map[string]any{ "type": "integer", "description": "Number of items to return (optional, default: 50)", "minimum": 1, "maximum": 100, }, - "offset": map[string]interface{}{ + "offset": map[string]any{ "type": "integer", "description": "Number of items to skip (optional, default: 0)", "minimum": 0, @@ -168,7 +168,7 @@ func (m *MCPServer) AddTools() []server.ServerTool { Description: "Get a list of all items", InputSchema: mcp.ToolInputSchema{ Type: "object", - Properties: map[string]interface{}{}, + Properties: map[string]any{}, }, }, Handler: m.getItems, @@ -180,8 +180,8 @@ func (m *MCPServer) AddTools() []server.ServerTool { Description: "Get detailed information about a specific item by ID", InputSchema: mcp.ToolInputSchema{ Type: "object", - Properties: map[string]interface{}{ - "item_id": map[string]interface{}{ + Properties: map[string]any{ + "item_id": map[string]any{ "type": "string", "description": "The unique identifier of the item", }, @@ -197,8 +197,8 @@ func (m *MCPServer) AddTools() []server.ServerTool { Description: "Get items that can be obtained from a specific monster", InputSchema: mcp.ToolInputSchema{ Type: "object", - Properties: map[string]interface{}{ - "monster_id": map[string]interface{}{ + Properties: map[string]any{ + "monster_id": map[string]any{ "type": "string", "description": "The unique identifier of the monster", }, @@ -214,7 +214,7 @@ func (m *MCPServer) AddTools() []server.ServerTool { Description: "Get a list of all skills with their level details", InputSchema: mcp.ToolInputSchema{ Type: "object", - Properties: map[string]interface{}{}, + Properties: map[string]any{}, }, }, Handler: m.getSkills, @@ -225,8 +225,8 @@ func (m *MCPServer) AddTools() []server.ServerTool { Description: "Get detailed information about a specific skill by ID", InputSchema: mcp.ToolInputSchema{ Type: "object", - Properties: map[string]interface{}{ - "skill_id": map[string]interface{}{ + Properties: map[string]any{ + "skill_id": map[string]any{ "type": "string", "description": "The unique identifier of the skill", }, diff --git a/internal/database/mysql/db_connect.go b/internal/database/mysql/db_connect.go index 5f155be9..f8972390 100644 --- a/internal/database/mysql/db_connect.go +++ b/internal/database/mysql/db_connect.go @@ -60,7 +60,7 @@ func New(ctx context.Context) context.Context { func connect(ctx context.Context, dialector gorm.Dialector) context.Context { var err error - for i := 0; i < MAX_RETRY; i++ { + for i := range MAX_RETRY { if db, err = gorm.Open(dialector, &gorm.Config{ NamingStrategy: schema.NamingStrategy{ SingularTable: false, diff --git a/internal/database/mysql/sentry.go b/internal/database/mysql/sentry.go index 72204bd7..ef19857d 100644 --- a/internal/database/mysql/sentry.go +++ b/internal/database/mysql/sentry.go @@ -31,19 +31,19 @@ func (l *SentryLogger) LogMode(level logger.LogLevel) logger.Interface { return &newlogger } -func (l *SentryLogger) Info(ctx context.Context, msg string, data ...interface{}) { +func (l *SentryLogger) Info(ctx context.Context, msg string, data ...any) { if l.logLevel >= logger.Info { slog.Log(ctx, constant.SeverityInfo, fmt.Sprintf(msg, data...)) } } -func (l *SentryLogger) Warn(ctx context.Context, msg string, data ...interface{}) { +func (l *SentryLogger) Warn(ctx context.Context, msg string, data ...any) { if l.logLevel >= logger.Warn { slog.Log(ctx, constant.SeverityWarn, fmt.Sprintf(msg, data...)) } } -func (l *SentryLogger) Error(ctx context.Context, msg string, data ...interface{}) { +func (l *SentryLogger) Error(ctx context.Context, msg string, data ...any) { if l.logLevel >= logger.Error { slog.Log(ctx, constant.SeverityError, fmt.Sprintf(msg, data...)) } diff --git a/internal/database/mysql/testHelper.go b/internal/database/mysql/testHelper.go index c1b0a182..826a8728 100644 --- a/internal/database/mysql/testHelper.go +++ b/internal/database/mysql/testHelper.go @@ -70,9 +70,9 @@ func migrationTestData() { log.Fatal(err) } // テーブルのクリーンアップ - statements := strings.Split(string(truncateSQL), ";") + statements := strings.SplitSeq(string(truncateSQL), ";") // テーブルのクリーンアップ - for _, stmt := range statements { + for stmt := range statements { // 空の文を除外 if strings.TrimSpace(stmt) != "" { if err := testDB.Exec(stmt).Error; err != nil { diff --git a/pkg/testutil/golden.go b/pkg/testutil/golden.go index d0b5413e..2917ad73 100644 --- a/pkg/testutil/golden.go +++ b/pkg/testutil/golden.go @@ -30,7 +30,7 @@ func AssertGoldenJSON(t *testing.T, goldenFile string, actual []byte) { require.NoError(t, err) // JSON形式に整形して比較 - var expectedJSON, actualJSON interface{} + var expectedJSON, actualJSON any err = json.Unmarshal(expected, &expectedJSON) require.NoError(t, err)