golang-stretchr-testify
Write Better Go Tests with Testify
Testify gives Go developers readable assertions, reliable mocks, and structured suites. This skill helps AI generate and review focused tests with correct failure behavior and expectation checks.
自分のエージェントでインストール
このリクエストをエージェントにコピーしてください。正規の Skill ページとマニフェストが含まれています。
Review the Skillstore skill "golang-stretchr-testify" from https://skillstore.io/skills/samber-golang-stretchr-testify.md and its manifest at https://skillstore.io/api/skills/samber-golang-stretchr-testify/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.エージェントは引き続き計画を提示し、セキュリティポリシーで必要な確認を求める必要があります。
エージェントが読めるリソース
AI エージェント、クローラー、スクリプトがページ全体ではなく整理されたコンテキストを必要とする場合は、これらのリンクを使ってください。
テストする
「golang-stretchr-testify」を使用しています。 How should a test handle a wrapped ErrNotFound value?
期待される結果:
Use testify ErrorIs to match the wrapped error chain. Reserve equality assertions for values that require exact comparison.
「golang-stretchr-testify」を使用しています。 Why did my mock-based test pass when the dependency was never called?
期待される結果:
- Define the expected method call with an explicit call count.
- Run AssertExpectations at the end of the test.
- Use a specific matcher when the argument must be validated.
「golang-stretchr-testify」を使用しています。 How should a suite initialize a fresh mock for every test?
期待される結果:
Use SetupTest for per-test state, reserve SetupSuite for shared resources, and include the launcher that calls suite.Run.
セキュリティ監査
安全All 38 static findings are false positives caused by prose, Markdown delimiters, Go raw string literals, evaluation text, or benign metadata. The reviewed files contain no evidence of executable shell commands, dynamic loading, system reconnaissance, network activity, or prompt injection.
リスク要因
⚡ スクリプトを含む (2)
⚙️ 外部コマンド (33)
🌐 ネットワークアクセス (1)
このレポートを共有・引用
バージョン付き評価レポート、中立的なバッジ、埋め込みカード、引用を共有できます。Skillstore は証拠を報告しますが、この Skill が安全かどうかは判断しません。
レポートリンクをコピー
https://skillstore.io/skills/samber-golang-stretchr-testify/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdownバッジ
[](https://skillstore.io/skills/samber-golang-stretchr-testify?utm_source=security_passport_badge)HTMLバッジ
<a href="https://skillstore.io/skills/samber-golang-stretchr-testify?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/samber-golang-stretchr-testify/security.svg" alt="Skillstore security assessment" loading="lazy"></a>埋め込みカード
<iframe src="https://skillstore.io/embed/skills/samber-golang-stretchr-testify.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学術引用 (APA · BibTeX · CFF)
APA形式の引用
samber. (2026). golang-stretchr-testify security audit report (audit version 1) [Author version 1.3.1]. Skillstore. https://skillstore.io/skills/samber-golang-stretchr-testify/audits/1BibTeX形式の引用
@techreport{samber-samber-golang-stretchr-testify-2026,
author = {samber},
title = {golang-stretchr-testify security audit report (audit version 1)},
institution = {Skillstore},
year = {2026},
number = {1},
url = {https://skillstore.io/skills/samber-golang-stretchr-testify/audits/1},
note = {Author version 1.3.1}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "golang-stretchr-testify security audit report (audit version 1)"
version: "1.3.1"
type: report
authors:
- name: "samber"
date-released: "2026-09-23"
url: "https://skillstore.io/skills/samber-golang-stretchr-testify/audits/1"
identifiers:
- type: other
value: "skillstore:samber-golang-stretchr-testify:audit:1"
description: "Skillstore immutable audit report identifier"
Skillstore スコア
このスコアの理由 証拠の信頼度: 中作成できるもの
Add focused unit tests
Generate readable Go tests with fail-fast preconditions and clear value assertions for new functions.
Build dependable mocks
Define mock expectations, argument matchers, call counts, and retry responses for isolated service tests.
Review existing test suites
Find assertion-order errors, missing expectation verification, incorrect suite lifecycle usage, and pointer comparison mistakes.
これらのプロンプトを試す
Write a testify test for a function that parses a configuration. Use require for parsing and nil preconditions, then use assert for expected field values.
Create a testify mock for a Sender interface. Verify one call with a specific email, use a context matcher, and check all expectations.
Convert these related Go tests into a testify suite. Use shared database setup, fresh mock state before each test, cleanup hooks, and a working suite launcher.
Design a testify test for an asynchronous client that retries after a timeout. Use sequential mock returns, EventuallyWithT, collected assertions, and explicit timeout intervals.
ベストプラクティス
- Use require for setup failures that make later assertions unsafe, and use assert for independent outcomes.
- Make mock expectations explicit with suitable matchers, call counts, and final verification.
- Keep suite lifecycle responsibilities clear and run testifylint during review or continuous integration.
回避
- Using assert for a nil-sensitive precondition and then dereferencing the failed value.
- Comparing wrapped errors with direct equality instead of checking the error chain.
- Defining mock expectations without verifying them or creating a suite without its launcher.
よくある質問
When should I use require instead of assert?
How do I check a wrapped Go error?
How do I verify a mock call count?
What matcher ignores an argument value?
How do testify suites run?
Can this skill replace testify documentation?
開発者情報
作成者
samberライセンス
MIT
作者バージョン
v1.3.1
Skillstore リビジョン
r1
参照
2aa351cb09c29b7287d263bd8ea81e9bee3b2a61
メンテナンスの新しさ
2026/9/30
利用状況
0 ダウンロード · 0 閲覧
ファイル構成