[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F3H8AV074AT40590P5XG7M":3,"skill-same:01M6F3H8AV074AT40590P5XG7M":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":52,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":54,"updatedAt":55,"install":56,"resources":69},"01M6F3H8AV074AT40590P5XG7M","go-declarations",null,"Use when declaring or initializing Go variables, constants, structs, or maps — including var vs :=, reducing scope with if-init, formatting composite literals, designing iota enums, and using any instead of interface{}. Also use when writing a new struct or const block, even if the user doesn't ask about declaration style. Does not cover naming conventions (see go-naming).","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fcxuu\u002Fgolang-skills\u002Fgo-declarations\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"go declarations","go","formatting","naming","Variables","interface","block","with","about","scope","style","writing","conventions","maps","use","guide","user","ask","init","google","2026-11-10 10:12:30",false,"---\nname: go-declarations\ndescription: Use when declaring or initializing Go variables, constants, structs, or maps — including var vs :=, reducing scope with if-init, formatting composite literals, designing iota enums, and using any instead of interface{}. Also use when writing a new struct or const block, even if the user doesn't ask about declaration style. Does not cover naming conventions (see go-naming).\nlicense: Apache-2.0\ncompatibility: Uses any keyword (Go 1.18+)\nmetadata:\n  sources: \"Google Style Guide, Uber Style Guide\"\n---\n\n# Go Declarations and Initialization\n\n---\n\n## Quick Reference: var vs :=\n\n| Context | Use | Example |\n|---------|-----|---------|\n| Top-level | `var` (always) | `var _s = F()` |\n| Local with value | `:=` | `s := \"foo\"` |\n| Local zero-value (intentional) | `var` | `var filtered []int` |\n| Type differs from expression | `var` with type | `var _e error = F()` |\n\n> Read [references\u002FSCOPE.md](references\u002FSCOPE.md) when deciding between var and := in complex initialization patterns or multi-return assignments.\n\n---\n\n## Group Similar Declarations\n\nGroup related `var`, `const`, `type` in parenthesized blocks. Separate\n**unrelated** declarations into distinct blocks.\n\n```go\n\u002F\u002F Bad\nconst a = 1\nconst b = 2\n\n\u002F\u002F Good\nconst (\n    a = 1\n    b = 2\n)\n```\n\nInside functions, group adjacent vars even if unrelated:\n\n```go\nvar (\n    caller  = c.name\n    format  = \"json\"\n    timeout = 5 * time.Second\n)\n```\n\n---\n\n## Constants and iota\n\nStart enums at one so the zero value represents invalid\u002Funset:\n\n```go\nconst (\n    Add Operation = iota + 1\n    Subtract\n    Multiply\n)\n```\n\nUse zero when the default behavior is desirable (e.g., `LogToStdout`).\n\n> Read [references\u002FIOTA.md](references\u002FIOTA.md) when designing iota enums with bitmask patterns, byte-size constants, or String() methods.\n\n---\n\n## Variable Scope\n\nUse if-init to limit scope when the result is only needed for the error check:\n\n```go\nif err := os.WriteFile(name, data, 0644); err != nil {\n    return err\n}\n```\n\nDon't reduce scope if it forces deeper nesting or you need the result outside\nthe `if`. Move constants into functions when only used there.\n\n> Read [references\u002FSCOPE.md](references\u002FSCOPE.md) when working with top-level declarations or choosing between var and := for local variables.\n\n---\n\n## Initializing Structs\n\n- **Always use field names** (enforced by `go vet`). Exception: test tables\n  with ≤3 fields.\n- **Omit zero-value fields** — let Go set defaults.\n- **Use `var` for zero-value structs**: `var user User` not `user := User{}`\n- **Use `&T{}` over `new(T)`**: `sptr := &T{Name: \"bar\"}`\n\n> Read [references\u002FSTRUCTS.md](references\u002FSTRUCTS.md) when initializing structs with many fields, building slices of struct pointers, or choosing single-line vs multi-line format.\n\n---\n\n## Composite Literal Formatting\n\nUse field names for external package types. Match closing brace indentation\nwith the opening line. Omit repeated type names in slice\u002Fmap literals\n(`gofmt -s`).\n\n> Read [references\u002FINITIALIZATION.md](references\u002FINITIALIZATION.md) when working with complex composite literals, cuddled braces, or zero-value field decisions.\n\n> Read [references\u002FLITERALS.md](references\u002FLITERALS.md) when formatting complex composite literals.\n\n---\n\n## Initializing Maps\n\n| Scenario | Use | Example |\n|----------|-----|---------|\n| Empty, populated later | `make(map[K]V)` | `m := make(map[string]int)` |\n| Nil declaration | `var` | `var m map[string]int` |\n| Fixed entries at init | Literal | `m := map[string]int{\"a\": 1}` |\n\n`make()` visually distinguishes empty-but-initialized from nil. Use size hints\nwhen the count is known.\n\n---\n\n## Raw String Literals\n\nUse backtick strings to avoid hand-escaped characters:\n\n```go\n\u002F\u002F Bad\nwantError := \"unknown name:\\\"test\\\"\"\n\n\u002F\u002F Good\nwantError := `unknown name:\"test\"`\n```\n\nIdeal for regex, SQL, JSON, and multi-line text.\n\n---\n\n## Prefer `any` Over `interface{}`\n\nGo 1.18+: use `any` instead of `interface{}` in all new code.\n\n---\n\n## Avoid Shadowing Built-In Names\n\nNever use predeclared identifiers (`error`, `string`, `len`, `cap`, `append`,\n`copy`, `new`, `make`, `close`, `delete`, `panic`, `recover`, `any`, `true`,\n`false`, `nil`, `iota`) as names. Use `go vet` to detect.\n\n```go\n\u002F\u002F Bad — shadows the builtin\nvar error string\n\n\u002F\u002F Good\nvar errorMessage string\n```\n\n> Read [references\u002FSHADOWING.md](references\u002FSHADOWING.md) when debugging issues where := creates new variables that shadow outer scope.\n\n---\n\n## Related Skills\n\n- **Naming conventions**: See [go-naming](..\u002Fgo-naming\u002FSKILL.md) when choosing variable names, constant names, or deciding name length by scope\n- **Data structures**: See [go-data-structures](..\u002Fgo-data-structures\u002FSKILL.md) when choosing between `new` and `make`, or initializing slices and maps\n- **Control flow scoping**: See [go-control-flow](..\u002Fgo-control-flow\u002FSKILL.md) when using if-init, `:=` redeclaration, or avoiding variable shadowing\n- **Capacity hints**: See [go-performance](..\u002Fgo-performance\u002FSKILL.md) when pre-allocating maps or slices with known sizes\n\n","# Go Declarations and Initialization\n\n---\n\n## Quick Reference: var vs :=\n\n| Context | Use | Example |\n|---------|-----|---------|\n| Top-level | `var` (always) | `var _s = F()` |\n| Local with value | `:=` | `s := \"foo\"` |\n| Local zero-value (intentional) | `var` | `var filtered []int` |\n| Type differs from expression | `var` with type | `var _e error = F()` |\n\n> Read [references\u002FSCOPE.md](references\u002FSCOPE.md) when deciding between var and := in complex initialization patterns or multi-return assignments.\n\n---\n\n## Group Similar Declarations\n\nGroup related `var`, `const`, `type` in parenthesized blocks. Separate\n**unrelated** declarations into distinct blocks.\n\n```go\n\u002F\u002F Bad\nconst a = 1\nconst b = 2\n\n\u002F\u002F Good\nconst (\n    a = 1\n    b = 2\n)\n```\n\nInside functions, group adjacent vars even if unrelated:\n\n```go\nvar (\n    caller  = c.name\n    format  = \"json\"\n    timeout = 5 * time.Second\n)\n```\n\n---\n\n## Constants and iota\n\nStart enums at one so the zero value represents invalid\u002Funset:\n\n```go\nconst (\n    Add Operation = iota + 1\n    Subtract\n    Multiply\n)\n```\n\nUse zero when the default behavior is desirable (e.g., `LogToStdout`).\n\n> Read [references\u002FIOTA.md](references\u002FIOTA.md) when designing iota enums with bitmask patterns, byte-size constants, or String() methods.\n\n---\n\n## Variable Scope\n\nUse if-init to limit scope when the result is only needed for the error check:\n\n```go\nif err := os.WriteFile(name, data, 0644); err != nil {\n    return err\n}\n```\n\nDon't reduce scope if it forces deeper nesting or you need the result outside\nthe `if`. Move constants into functions when only used there.\n\n> Read [references\u002FSCOPE.md](references\u002FSCOPE.md) when working with top-level declarations or choosing between var and := for local variables.\n\n---\n\n## Initializing Structs\n\n- **Always use field names** (enforced by `go vet`). Exception: test tables\n  with ≤3 fields.\n- **Omit zero-value fields** — let Go set defaults.\n- **Use `var` for zero-value structs**: `var user User` not `user := User{}`\n- **Use `&T{}` over `new(T)`**: `sptr := &T{Name: \"bar\"}`\n\n> Read [references\u002FSTRUCTS.md](references\u002FSTRUCTS.md) when initializing structs with many fields, building slices of struct pointers, or choosing single-line vs multi-line format.\n\n---\n\n## Composite Literal Formatting\n\nUse field names for external package types. Match closing brace indentation\nwith the opening line. Omit repeated type names in slice\u002Fmap literals\n(`gofmt -s`).\n\n> Read [references\u002FINITIALIZATION.md](references\u002FINITIALIZATION.md) when working with complex composite literals, cuddled braces, or zero-value field decisions.\n\n> Read [references\u002FLITERALS.md](references\u002FLITERALS.md) when formatting complex composite literals.\n\n---\n\n## Initializing Maps\n\n| Scenario | Use | Example |\n|----------|-----|---------|\n| Empty, populated later | `make(map[K]V)` | `m := make(map[string]int)` |\n| Nil declaration | `var` | `var m map[string]int` |\n| Fixed entries at init | Literal | `m := map[string]int{\"a\": 1}` |\n\n`make()` visually distinguishes empty-but-initialized from nil. Use size hints\nwhen the count is known.\n\n---\n\n## Raw String Literals\n\nUse backtick strings to avoid hand-escaped characters:\n\n```go\n\u002F\u002F Bad\nwantError := \"unknown name:\\\"test\\\"\"\n\n\u002F\u002F Good\nwantError := `unknown name:\"test\"`\n```\n\nIdeal for regex, SQL, JSON, and multi-line text.\n\n---\n\n## Prefer `any` Over `interface{}`\n\nGo 1.18+: use `any` instead of `interface{}` in all new code.\n\n---\n\n## Avoid Shadowing Built-In Names\n\nNever use predeclared identifiers (`error`, `string`, `len`, `cap`, `append`,\n`copy`, `new`, `make`, `close`, `delete`, `panic`, `recover`, `any`, `true`,\n`false`, `nil`, `iota`) as names. Use `go vet` to detect.\n\n```go\n\u002F\u002F Bad — shadows the builtin\nvar error string\n\n\u002F\u002F Good\nvar errorMessage string\n```\n\n> Read [references\u002FSHADOWING.md](references\u002FSHADOWING.md) when debugging issues where := creates new variables that shadow outer scope.\n\n---\n\n## Related Skills\n\n- **Naming conventions**: See [go-naming](..\u002Fgo-naming\u002FSKILL.md) when choosing variable names, constant names, or deciding name length by scope\n- **Data structures**: See [go-data-structures](..\u002Fgo-data-structures\u002FSKILL.md) when choosing between `new` and `make`, or initializing slices and maps\n- **Control flow scoping**: See [go-control-flow](..\u002Fgo-control-flow\u002FSKILL.md) when using if-init, `:=` redeclaration, or avoiding variable shadowing\n- **Capacity hints**: See [go-performance](..\u002Fgo-performance\u002FSKILL.md) when pre-allocating maps or slices with known sizes\n\n",{"name":5,"license":15,"metadata":44,"description":7,"compatibility":46},{"sources":45},"Google Style Guide, Uber Style Guide","Uses any keyword (Go 1.18+)","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fcxuu\u002Fgolang-skills\u002Fgo-declarations",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill go-declarations",{"tool":62,"command":63},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill go-declarations",{"tool":65,"command":66},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill go-declarations","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fcxuu\u002Fgolang-skills\u002Fgo-declarations\u002FSKILL.md",true,[],[71,86,96,105,111,118],{"skillNo":72,"name":73,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":82,"publishedAt":39},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[77],{"categoryNo":78,"categoryName":79,"taxonomyType":80,"taxonomyTypeDesc":81},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[83,84,85],"model","model hierarchy","model hierarchy skill",{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":92,"publishedAt":39},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[91],{"categoryNo":78,"categoryName":79,"taxonomyType":80,"taxonomyTypeDesc":81},[93,94,95],"MCP","zoom","zoom mcp",{"skillNo":97,"name":98,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":39},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[102,103,104,94],"sdk","zoom apps sdk","apps",{"skillNo":106,"name":107,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":39},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[107],{"skillNo":112,"name":113,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":117,"publishedAt":39},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[116],{"categoryNo":78,"categoryName":79,"taxonomyType":80,"taxonomyTypeDesc":81},[113],{"skillNo":119,"name":120,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":39},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[120]]