golang-testing
Build Reliable Go Tests
Go test suites can miss edge cases, leak goroutines, and fail unpredictably. This skill guides test design, review, and debugging with concrete Go testing patterns.
Установить с помощью моего Агента
Скопируйте этот запрос в своего Агента. Он содержит каноническую страницу Skill и манифест.
Review the Skillstore skill "golang-testing" from https://skillstore.io/skills/samber-golang-testing.md and its manifest at https://skillstore.io/api/skills/samber-golang-testing/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.Ваш Агент по-прежнему должен показать план и запросить все подтверждения, требуемые политикой безопасности.
Ресурсы для AI-агентов
Используйте эти ссылки, когда AI-агенту, crawler или script нужен чистый контекст вместо полной страницы.
Протестировать
Использование «golang-testing». Review tests that report every price subtest as passing even when the parent fails.
Ожидаемый результат:
- Finding: the assertion helper captures the parent test instead of the current subtest.
- Correction: create the assertion helper inside each subtest.
- Verification: deliberately break one expected result and confirm that the matching subtest reports failure.
Использование «golang-testing». Plan tests for a PostgreSQL order repository without affecting normal unit tests.
Ожидаемый результат:
- Separate database tests with an integration build tag.
- Start a disposable fixture, load the schema, reset records between tests, and close connections during teardown.
- Bind fixture ports to loopback and keep production credentials out of the test environment.
- Cover creation, missing records, user filtering, and database errors.
Использование «golang-testing». Improve tests for a worker pool that may leak goroutines.
Ожидаемый результат:
- Add package-level goroutine leak checks and verify shutdown after queued work completes.
- Coordinate workers with explicit synchronization instead of arbitrary delays.
- Run concurrent access tests with race detection and keep each test independently runnable.
Аудит безопасности
Средний рискAll 135 static alerts are false positives involving documentation, Go syntax, mocks, or explicit test operations. A separate integration fixture exposes weakly authenticated PostgreSQL and unauthenticated Redis through unrestricted host port bindings. No evidence found of malicious intent, credential exfiltration, or security-review prompt injection.
Подтверждённые проблемы безопасности (1)
Факторы риска
⚙️ Внешние команды (50)
🌐 Доступ к сети (6)
📁 Доступ к файловой системе (2)
⚡ Содержит скрипты (6)
🔑 Переменные окружения (1)
Поделиться и цитировать этот отчет
Делитесь версионным отчетом об оценке, нейтральным значком, встраиваемой карточкой и цитатами. Skillstore публикует доказательства, не решая, безопасен ли этот Skill.
Копировать ссылку на отчёт
https://skillstore.io/skills/samber-golang-testing/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportЗначок Markdown
[](https://skillstore.io/skills/samber-golang-testing?utm_source=security_passport_badge)Значок HTML
<a href="https://skillstore.io/skills/samber-golang-testing?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/samber-golang-testing/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Встраиваемая карточка
<iframe src="https://skillstore.io/embed/skills/samber-golang-testing.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-testing security audit report (audit version 1) [Author version 1.4.0]. Skillstore. https://skillstore.io/skills/samber-golang-testing/audits/1Цитата BibTeX
@techreport{samber-samber-golang-testing-2026,
author = {samber},
title = {golang-testing security audit report (audit version 1)},
institution = {Skillstore},
year = {2026},
number = {1},
url = {https://skillstore.io/skills/samber-golang-testing/audits/1},
note = {Author version 1.4.0}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "golang-testing security audit report (audit version 1)"
version: "1.4.0"
type: report
authors:
- name: "samber"
date-released: "2026-10-15"
url: "https://skillstore.io/skills/samber-golang-testing/audits/1"
identifiers:
- type: other
value: "skillstore:samber-golang-testing:audit:1"
description: "Skillstore immutable audit report identifier"
Сравнить варианты
2 устанавливаемых вариантовНавык каждого автора остаётся отдельным устанавливаемым вариантом. Рекомендуемый вариант ранжируется по данным Skillstore.
Почему этот вариант первый
89jobrien-golang-testing
2026-10-18
samber-golang-testing
2026-10-16
Оценка Skillstore
Почему такая оценка Достоверность доказательств: СреднийЧто вы можете построить
Add Unit Coverage
Create named subtests for public functions, boundary inputs, and error paths without coupling tests to private fields.
Review Test Reliability
Inspect pull request tests for assertion scope errors, shared mutable state, timing dependencies, and missing race checks.
Organize Integration Testing
Plan build-tagged database suites with fixture setup, per-test cleanup, and isolated test services.
Попробуйте эти промпты
Write named table-driven tests for [function]. Cover normal inputs, empty inputs, boundary cases, and documented errors. Assert observable results.
Test [handler] using request and response recorders. Cover valid requests, malformed bodies, missing authentication, and validation errors. Assert status, headers, and response content.
Investigate flaky tests in [package]. Check shared state, goroutine cleanup, assertion scope, and timing dependencies. Propose deterministic tests and race detection commands.
Audit [repository] for unit coverage gaps, integration isolation, and goroutine risks. Separate findings by concern. Prioritize fixes with evidence and focused tests. Require disposable databases and loopback-only services.
Лучшие практики
- Assert public behavior with named cases, including boundary inputs and failure paths.
- Use disposable fixtures, loopback-only services, and explicit cleanup for integration tests.
- Match examples to your Go version and run focused tests before expanding coverage.
Избегать
- Treating a high coverage percentage as proof that assertions are correct.
- Sharing mutable fixtures, relying on execution order, or using arbitrary sleeps for synchronization.
- Running destructive fixture cleanup against shared databases or exposing test services to untrusted networks.