スキル一覧に戻る
mgreenly

patternsresult-type

by mgreenly

An AI Coding Agent

1🍴 0📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: patterns/result-type description: Result Type Pattern (C-Specific) pattern for C development

Result Type Pattern (C-Specific)

Return struct containing success/failure status plus value or error. Explicit error handling without exceptions. Caller must check result.

ikigai Application

Core type: res_t used throughout:

res_t result = ik_cfg_load(ctx, path, &cfg);
if (!result.ok) {
    // Handle error, result.error contains message
}

Macros:

  • OK(value) - Construct success result
  • ERR(msg) - Construct error result
  • TRY(expr) - Propagate error if failed
  • CHECK(cond, msg) - Return error if condition false

Benefits:

  • Errors can't be ignored (must check .ok)
  • Error context propagates up call stack
  • No hidden control flow (unlike exceptions)

See: project/error_handling.md for patterns.

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です