go-strings
CommunityMaster idiomatic Go string handling.
Authorv0lka
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Go developers often write inefficient or error-prone string handling routines. This skill provides guidance to write correct and efficient Go string code, covering rune semantics, iteration, trimming, conversion between string and []byte, and safe substring usage to avoid memory leaks.
Core Features & Use Cases
- Rune-aware string iteration: correctly range over strings to access runes rather than bytes.
- Efficient concatenation: prefer strings.Builder with pre-growth when total size is known.
- Substrings safety: avoid keeping large backing arrays by cloning substrings when storing them.
- Trim vs trim functions: choose TrimPrefix/TrimSuffix for fixed strings and TrimLeft/TrimRight/Trim for cutsets.
- Use-case example: refactor a function that concatenates 100 short strings into a single string efficiently without excessive allocations.
Quick Start
Refactor a Go function to use strings.Builder for efficient concatenation of a given slice of strings.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: go-strings Download link: https://github.com/v0lka/skills/archive/main.zip#go-strings Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.