Created
June 13, 2026 18:58
-
-
Save baturax/ad37f15b4cc338557af6c6af6f35ddfb to your computer and use it in GitHub Desktop.
zed snippets for golang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Create function": { | |
| "prefix": "func", | |
| "body": ["func ${1}(${2}) (${3}) {\n\t${0}\n}"], | |
| "description": "Creates a function" | |
| }, | |
| "Create method": { | |
| "prefix": "meth", | |
| "body": ["func (${1}) ${2}(${3}) (${4}) {\n\t${0}\n}"], | |
| "description": "Creates a method" | |
| }, | |
| "Fiber function": { | |
| "prefix": "fctx", | |
| "body": ["func ${1}(c fiber.Ctx) error {\n\tctx, cancel := context.WithTimeout(c.Context(), 5*time.Second)\n\tdefer cancel()\n\n\t${0}\n\n\treturn nil\n}"], | |
| "description": "Creates a fiber route" | |
| }, | |
| "Create struct": { | |
| "prefix": "tys", | |
| "body": ["type ${1} struct {\n\t${0}\n}"], | |
| "description": "Creates a struct" | |
| }, | |
| "Json struct": { | |
| "prefix": "jstr", | |
| "body": ["`json:\"${1}\"`"], | |
| "description": "Creates a json in struct" | |
| }, | |
| "Json & Validate struct": { | |
| "prefix": "jsvtr", | |
| "body": ["`json:\"${1}\" validate:\"required\"`"], | |
| "description": "Creates a json in struct" | |
| }, | |
| "Create if err": { | |
| "prefix": "iferr", | |
| "body": ["if err != nil {\n\t${0}\n\t}"], | |
| "description": "Create an if != err {}" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment