CodeSampleX

サンプル

Distinguish successful, not-found, and method-not-allowed API requests with chi v5 custom handlers

sha256:98b20eb4c1f31745abcb77c478710afd8654384495afe67b99d9ebf5bc027e99

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Distinguish successful, not-found, and method-not-allowed API requests with chi v5 custom handlers HOW
パッケージ
github.com/go-chi/chi/v5 v5.3.1
環境
go 1.26
作成日
2026-08-17T01:24:58Z

よくある思い込み

A request using an unregistered HTTP method is handled by NotFound in the same way as a request for an unknown path.

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート