AgentSkillsCN

ioutil-scan

扫描仓库,及时移除已废弃的io/ioutil使用方式。

SKILL.md
--- frontmatter
name: ioutil-scan
description: Scan repositories for deprecated io/ioutil usage
argument-hint: "[--create-issues]"
allowed-tools:
  - Bash(./scripts/ioutil-deprecation-checker.sh:*)
  - Read

io/ioutil Deprecation Scanner

Scan GitHub organizations for repositories still using the deprecated io/ioutil package.

Arguments: "$ARGUMENTS"

Why This Matters

The io/ioutil package was deprecated in Go 1.16 and its functions moved to io and os packages. While the package still exists for compatibility, new code should use the replacement functions.

Replacements

DeprecatedReplacement
ioutil.ReadAllio.ReadAll
ioutil.ReadFileos.ReadFile
ioutil.WriteFileos.WriteFile
ioutil.ReadDiros.ReadDir
ioutil.TempDiros.MkdirTemp
ioutil.TempFileos.CreateTemp
ioutil.Discardio.Discard
ioutil.NopCloserio.NopCloser

Workflow

Run the ioutil deprecation checker with any provided options:

bash
./scripts/ioutil-deprecation-checker.sh $ARGUMENTS

Options

OptionDescription
--create-issuesCreate tracking issues in affected repos
--help, -hShow detailed help

Usage Examples

code
/ioutil-scan                  # Scan only
/ioutil-scan --create-issues  # Scan and create issues
/ioutil-scan --help           # Show help

Output

  • Real-time progress for each repository
  • Markdown report: ioutil-usage-report.md
  • Updates tracking issue in telco-bot repo