{"_id":"serverless-plugin-go","_rev":"7-a1c7699c4bab821da3ecf7ccd8d73580","name":"serverless-plugin-go","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"serverless-plugin-go","version":"0.0.1","keywords":["serverless","serverless framework","serverless plugin","amazon web services","aws","lambda","golang","go"],"author":{"name":"Maciej Winnicki","email":"maciej.winnicki@gmail.com"},"license":"MIT","_id":"serverless-plugin-go@0.0.1","maintainers":[{"name":"drafteame","email":"infra@draftea.com"}],"contributors":[{"url":"https://github.com/danteay","name":"Eduardo Aguilar","email":"dante.aguilar41@gmail.com"}],"homepage":"https://github.com/Drafteame/serverless-plugin-go#readme","bugs":{"url":"https://github.com/Drafteame/serverless-plugin-go/issues"},"dist":{"shasum":"d0e122b9a511cbcee82bd6c94d6e82d91d13ac2d","tarball":"https://registry.npmjs.org/serverless-plugin-go/-/serverless-plugin-go-0.0.1.tgz","fileCount":13,"integrity":"sha512-mmClGYIcCj98fx68kDPc5Nt5WYHZH0zdeKttGQkOMoOUVApOFWZtSzX9VvJ+FQEvq5sb5PSzUFfGY9UHYwydPw==","signatures":[{"sig":"MEYCIQCLjRne2oJ/GSaW87iT6OyQvVCbi6MQYoyfy8NrpRQaDgIhAMSkyjhH6qwxPOwKQfoEJYQvDiY9HCGB66bGy76mtb2o","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25236},"main":"index.js","type":"module","gitHead":"0354055b4aea86114e60302127cc88e0aab739a4","scripts":{"lint":"npx eslint --fix .","test":"npx mocha index.test.js","format":"npx prettier --write .","pre-commit":"pre-commit install --hook-type commit-msg","depsUpgrade":"node ./scripts/updateDeps.cjs"},"_npmUser":{"name":"drafteame","email":"infra@draftea.com"},"repository":{"url":"git+https://github.com/Drafteame/serverless-plugin-go.git","type":"git"},"_npmVersion":"10.1.0","description":"Serverless Framework plugin that compiles Go functions on the fly","directories":{},"_nodeVersion":"20.8.1","dependencies":{"util":"^0.12.5","chalk":"^5.3.0","adm-zip":"^0.5.10","pretty-hrtime":"^1.0.3"},"_hasShrinkwrap":false,"devDependencies":{"fs":"^0.0.1-security","chai":"^4.3.10","mocha":"^10.2.0","sinon":"^17.0.0","eslint":"^8.52.0","prettier":"^3.0.3","sinon-chai":"^3.7.0","child_process":"^1.0.2","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","eslint-config-airbnb-base":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/serverless-plugin-go_0.0.1_1698341376606_0.08595570008913178","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"serverless-plugin-go","version":"0.0.2","keywords":["serverless","serverless framework","serverless plugin","amazon web services","aws","lambda","golang","go"],"author":{"name":"Maciej Winnicki","email":"maciej.winnicki@gmail.com"},"license":"MIT","_id":"serverless-plugin-go@0.0.2","maintainers":[{"name":"drafteame","email":"infra@draftea.com"}],"contributors":[{"url":"https://github.com/danteay","name":"Eduardo Aguilar","email":"dante.aguilar41@gmail.com"}],"homepage":"https://github.com/Drafteame/serverless-plugin-go#readme","bugs":{"url":"https://github.com/Drafteame/serverless-plugin-go/issues"},"dist":{"shasum":"d362e912279b01c0f92bf61c85418385e6323537","tarball":"https://registry.npmjs.org/serverless-plugin-go/-/serverless-plugin-go-0.0.2.tgz","fileCount":13,"integrity":"sha512-GElNS5aXqJCoOxc8xLa+XYBuH81kSgVXqiM5T7frlKpx1hH/yNk32VrdzcZUySEx8E84eSRmSOpiou+ZIje0ow==","signatures":[{"sig":"MEQCIGVFI97gbB5+BLaNbIc/bW+7GLmOavZke4++DQyDCeLuAiAls6u+voVCWan+ACs5u9k7ny7k2TdWO5OBSt88KFDIpw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27209},"main":"index.js","type":"module","gitHead":"b806a970529462f6f4e4f09e516b56ac8bfa3b1b","scripts":{"lint":"npx eslint --fix .","test":"npx mocha index.test.js","format":"npx prettier --write .","pre-commit":"pre-commit install --hook-type commit-msg","depsUpgrade":"node ./scripts/updateDeps.cjs"},"_npmUser":{"name":"drafteame","email":"infra@draftea.com"},"repository":{"url":"git+https://github.com/Drafteame/serverless-plugin-go.git","type":"git"},"_npmVersion":"10.1.0","description":"Serverless Framework plugin that compiles Go functions on the fly","directories":{},"_nodeVersion":"20.9.0","dependencies":{"util":"^0.12.5","chalk":"^5.3.0","adm-zip":"^0.5.10","p-limit":"^5.0.0","pretty-hrtime":"^1.0.3"},"_hasShrinkwrap":false,"devDependencies":{"fs":"^0.0.1-security","chai":"^4.3.10","mocha":"^10.2.0","sinon":"^17.0.0","eslint":"^8.52.0","prettier":"^3.0.3","sinon-chai":"^3.7.0","child_process":"^1.0.2","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","eslint-config-airbnb-base":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/serverless-plugin-go_0.0.2_1700173334131_0.004566436516722172","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"serverless-plugin-go","version":"0.0.3","keywords":["serverless","serverless framework","serverless plugin","amazon web services","aws","lambda","golang","go"],"author":{"name":"Maciej Winnicki","email":"maciej.winnicki@gmail.com"},"license":"MIT","_id":"serverless-plugin-go@0.0.3","maintainers":[{"name":"draftea-infra","email":"infra@draftea.com"}],"contributors":[{"url":"https://github.com/danteay","name":"Eduardo Aguilar","email":"dante.aguilar41@gmail.com"}],"homepage":"https://github.com/Drafteame/serverless-plugin-go#readme","bugs":{"url":"https://github.com/Drafteame/serverless-plugin-go/issues"},"dist":{"shasum":"5d0d7fb430c14f5a00e7194469d5625126bff148","tarball":"https://registry.npmjs.org/serverless-plugin-go/-/serverless-plugin-go-0.0.3.tgz","fileCount":13,"integrity":"sha512-OSXjYGIfDAqXr7YV7DxHBqzjNQXOmp2oG5rZHCt49KQnYln8KyJ7ojy3/ulMguBCae3GS0cNSkKFI4x6Gyv29w==","signatures":[{"sig":"MEYCIQDMIwvoNK5hw+XIVpWtHKRMTTnwMC3xHmFNJ4NpmQGO+QIhAO7oH2aKY+JdG0zv0LXG2+YGJr2RxMVGTUvmNDMM7ICt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27272},"main":"index.js","type":"module","gitHead":"987dbcc50627d102acf7d01bffff2c40e270d916","scripts":{"lint":"npx eslint --fix .","test":"npx mocha index.test.js","format":"npx prettier --write .","pre-commit":"pre-commit install --hook-type commit-msg","depsUpgrade":"node ./scripts/updateDeps.cjs"},"_npmUser":{"name":"draftea-infra","email":"infra@draftea.com"},"repository":{"url":"git+https://github.com/Drafteame/serverless-plugin-go.git","type":"git"},"_npmVersion":"10.8.1","description":"Serverless Framework plugin that compiles Go functions on the fly","directories":{},"_nodeVersion":"20.16.0","dependencies":{"util":"^0.12.5","chalk":"^5.3.0","adm-zip":"^0.5.10","p-limit":"^5.0.0","pretty-hrtime":"^1.0.3"},"_hasShrinkwrap":false,"devDependencies":{"fs":"^0.0.1-security","chai":"^4.3.10","mocha":"^10.2.0","sinon":"^17.0.0","eslint":"^8.52.0","prettier":"^3.0.3","sinon-chai":"^3.7.0","child_process":"^1.0.2","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","eslint-config-airbnb-base":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/serverless-plugin-go_0.0.3_1724098898263_0.012603531652538136","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"serverless-plugin-go","version":"0.1.0","keywords":["serverless","serverless framework","serverless plugin","amazon web services","aws","lambda","golang","go"],"author":{"name":"Maciej Winnicki","email":"maciej.winnicki@gmail.com"},"license":"MIT","_id":"serverless-plugin-go@0.1.0","maintainers":[{"name":"draftea-infra","email":"infra@draftea.com"}],"contributors":[{"url":"https://github.com/danteay","name":"Eduardo Aguilar","email":"dante.aguilar41@gmail.com"}],"homepage":"https://github.com/Drafteame/serverless-plugin-go#readme","bugs":{"url":"https://github.com/Drafteame/serverless-plugin-go/issues"},"dist":{"shasum":"355d505c160ba583b672c199026688da6f44fdef","tarball":"https://registry.npmjs.org/serverless-plugin-go/-/serverless-plugin-go-0.1.0.tgz","fileCount":13,"integrity":"sha512-pG+ShzFuifOdz3gF53jL8mGgxG6CU53ShV++WLn7OK2nCK3nXnCTb2MLczvOEBC8sA3Stls4caAcZx0fXcCJ7Q==","signatures":[{"sig":"MEYCIQC9DwHQkNsYxmWp7t0uffI2ZTix0u360ejV3At3S/dWEgIhAKBe67ZsRMjqZTCmrhnXUiAMXWdQavD3zbAfvvy1t4v0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34358},"main":"index.js","type":"module","gitHead":"723d309b67443a7e3a509bfbb72d9e13b4328f55","scripts":{"lint":"npx eslint --fix .","test":"npx mocha index.test.js","format":"npx prettier --write .","pre-commit":"pre-commit install --hook-type commit-msg","depsUpgrade":"node ./scripts/updateDeps.cjs"},"_npmUser":{"name":"draftea-infra","email":"infra@draftea.com"},"repository":{"url":"git+https://github.com/Drafteame/serverless-plugin-go.git","type":"git"},"_npmVersion":"10.8.2","description":"Serverless Framework plugin that compiles Go functions on the fly","directories":{},"_nodeVersion":"20.19.4","dependencies":{"util":"^0.12.5","chalk":"^5.3.0","adm-zip":"^0.5.10","p-limit":"^5.0.0","pretty-hrtime":"^1.0.3"},"_hasShrinkwrap":false,"devDependencies":{"fs":"^0.0.1-security","chai":"^4.3.10","mocha":"^10.2.0","sinon":"^17.0.0","eslint":"^8.52.0","prettier":"^3.0.3","sinon-chai":"^3.7.0","child_process":"^1.0.2","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","eslint-config-airbnb-base":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/serverless-plugin-go_0.1.0_1755006130077_0.27879230976189495","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"serverless-plugin-go","version":"0.1.1","keywords":["serverless","serverless framework","serverless plugin","amazon web services","aws","lambda","golang","go"],"author":{"name":"Maciej Winnicki","email":"maciej.winnicki@gmail.com"},"license":"MIT","_id":"serverless-plugin-go@0.1.1","maintainers":[{"name":"draftea-infra","email":"infra@draftea.com"}],"contributors":[{"url":"https://github.com/danteay","name":"Eduardo Aguilar","email":"dante.aguilar41@gmail.com"}],"homepage":"https://github.com/Drafteame/serverless-plugin-go#readme","bugs":{"url":"https://github.com/Drafteame/serverless-plugin-go/issues"},"dist":{"shasum":"85d314a5edde738b86b22b72e20cf6b30af27d6e","tarball":"https://registry.npmjs.org/serverless-plugin-go/-/serverless-plugin-go-0.1.1.tgz","fileCount":13,"integrity":"sha512-BJ5bRngGIn8tl5OsS9IQrK2z7pcSFFXA8Fipg6UeHNmVLyvF9zF7ag0AANzVPx9VMdXNwFw8d3EkadYcSwiiMA==","signatures":[{"sig":"MEQCIA0O761mSjnRDgGlkSs9XM4BQO5Do+npbH/TiGrzxt9TAiAfCDZvGyZoTIngQD9yQ+urgsTSuNzBqXGzN0YLrTISMg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/serverless-plugin-go@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":34450},"main":"index.js","type":"module","gitHead":"606986ce7aad24ba8b3780ee3ab85c0c6f9916ab","scripts":{"lint":"npx eslint --fix .","test":"npx mocha index.test.js","format":"npx prettier --write .","pre-commit":"pre-commit install --hook-type commit-msg","depsUpgrade":"node ./scripts/updateDeps.cjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1e6b9d2b-06f8-45e8-bb61-03fbf232a9a9"}},"repository":{"url":"git+https://github.com/Drafteame/serverless-plugin-go.git","type":"git"},"_npmVersion":"11.6.2","description":"Serverless Framework plugin that compiles Go functions on the fly","directories":{},"_nodeVersion":"24.12.0","dependencies":{"util":"^0.12.5","chalk":"^5.3.0","adm-zip":"^0.5.10","p-limit":"^5.0.0","pretty-hrtime":"^1.0.3"},"_hasShrinkwrap":false,"devDependencies":{"fs":"^0.0.1-security","chai":"^4.3.10","mocha":"^10.2.0","sinon":"^17.0.0","eslint":"^8.52.0","prettier":"^3.0.3","sinon-chai":"^3.7.0","child_process":"^1.0.2","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","eslint-config-airbnb-base":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/serverless-plugin-go_0.1.1_1769019227481_0.6846033353208285","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"serverless-plugin-go","version":"0.1.2","type":"module","description":"Serverless Framework plugin that compiles Go functions on the fly","main":"index.js","scripts":{"lint":"npx eslint --fix .","format":"npx prettier --write .","test":"npx mocha index.test.js","depsUpgrade":"node ./scripts/updateDeps.cjs","pre-commit":"pre-commit install --hook-type commit-msg"},"repository":{"type":"git","url":"git+https://github.com/Drafteame/serverless-plugin-go.git"},"keywords":["serverless","serverless framework","serverless plugin","amazon web services","aws","lambda","golang","go"],"author":{"name":"Maciej Winnicki","email":"maciej.winnicki@gmail.com"},"contributors":[{"name":"Eduardo Aguilar","email":"dante.aguilar41@gmail.com","url":"https://github.com/danteay"}],"license":"MIT","bugs":{"url":"https://github.com/Drafteame/serverless-plugin-go/issues"},"homepage":"https://github.com/Drafteame/serverless-plugin-go#readme","dependencies":{"adm-zip":"^0.5.10","chalk":"^5.3.0","p-limit":"^5.0.0","pretty-hrtime":"^1.0.3","util":"^0.12.5"},"devDependencies":{"chai":"^4.3.10","child_process":"^1.0.2","eslint":"^8.52.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.29.0","eslint-plugin-prettier":"^5.0.1","fs":"^0.0.1-security","mocha":"^10.2.0","prettier":"^3.0.3","sinon":"^17.0.0","sinon-chai":"^3.7.0"},"gitHead":"383c676f8e09e08b8a009686d76bce1097995b04","_id":"serverless-plugin-go@0.1.2","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-11O+LmlSN8vr5OwskafgOPoaLqhbgc8hAE5m1fGabbGrk0Aedk6WK0lj7Il6h6EJPRgFlj3XzRWPKQXRGMcPgg==","shasum":"5e9408efeb46f4f1a027eb450a89ddc922032977","tarball":"https://registry.npmjs.org/serverless-plugin-go/-/serverless-plugin-go-0.1.2.tgz","fileCount":13,"unpackedSize":36173,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/serverless-plugin-go@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD6meuQj+4ZT6j/PWLOWW8WFUbBD3b8O3NRLL3XTEKKsgIhAJQ04gqr3woTUOR0rI6nyBEZvNCuY3Ipoonv9gZ8Qc4F"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1e6b9d2b-06f8-45e8-bb61-03fbf232a9a9"}},"directories":{},"maintainers":[{"name":"draftea-infra","email":"infra@draftea.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/serverless-plugin-go_0.1.2_1774988463767_0.13256141477487926"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-26T17:29:36.507Z","modified":"2026-03-31T20:21:04.276Z","0.0.1":"2023-10-26T17:29:36.929Z","0.0.2":"2023-11-16T22:22:14.332Z","0.0.3":"2024-08-19T20:21:38.467Z","0.1.0":"2025-08-12T13:42:10.306Z","0.1.1":"2026-01-21T18:13:47.635Z","0.1.2":"2026-03-31T20:21:03.958Z"},"bugs":{"url":"https://github.com/Drafteame/serverless-plugin-go/issues"},"author":{"name":"Maciej Winnicki","email":"maciej.winnicki@gmail.com"},"license":"MIT","homepage":"https://github.com/Drafteame/serverless-plugin-go#readme","keywords":["serverless","serverless framework","serverless plugin","amazon web services","aws","lambda","golang","go"],"repository":{"type":"git","url":"git+https://github.com/Drafteame/serverless-plugin-go.git"},"description":"Serverless Framework plugin that compiles Go functions on the fly","contributors":[{"name":"Eduardo Aguilar","email":"dante.aguilar41@gmail.com","url":"https://github.com/danteay"}],"maintainers":[{"name":"draftea-infra","email":"infra@draftea.com"}],"readme":"# ⚡️Serverless Framework Go Plugin\n\n[![npm](https://img.shields.io/npm/v/serverless-plugin-go)](https://www.npmjs.com/package/serverless-plugin-go)\n\n`serverless-plugin-go` is a Serverless Framework plugin that compiles Go functions on the fly. You don't need to do it manually before `serverless deploy`. Once the plugin is installed it will happen automatically.\n\n## Features\n\n- Concurrent compilation happens across all CPU cores.\n- Support for both `serverless deploy` and `serverless deploy function` commands.\n- Support for `serverless invoke local` command.\n- Additional command `serverless go build`.\n\n## Install\n\n1. Install the plugin\n\n    ```bash\n    npm i --save-dev serverless-plugin-go\n    ```\n\n1. Add it to your `serverless.yaml`\n\n    ```yaml\n    plugins:\n      - 'serverless-plugin-go'\n    ```\n\n1. Replace every Go function's `handler` with `*.go` file path or a package path. E.g.\n\n    ```yaml\n    functions:\n      example:\n        runtime: 'provided.al2023' # or provided.al2\n        handler: 'functions/example/main.go' # or just functions/example\n    ```\n\n## Configuration\n\nDefault values:\n\n```yaml\ncustom:\n  go:\n    # folder where go.mod file lives, if set `handler` property should be set relatively to that folder\n    baseDir: '.'\n\n    # Final target destination of the binary outputs\n    binDir: '.bin'\n\n    # Compile command that should be used to build binaries\n    cmd: 'go build -ldflags=\"-s -w\"'\n\n    # If enabled, builds function every directory (useful for monorepo where go.mod is managed by each function\n    monorepo: false\n\n    # Number of concurrent process used to compile functions, you can fine tune this number to your needs.\n    # Alternatively you can use the env var `SP_GO_CONCURRENCY` to override this configuration\n    concurrency: 5\n\n    # Environment variables used to compile binaries\n    env:\n      GOOS: 'linux' # Default compile OS\n      CGO_ENABLED: '0' # By default CGO is disabled\n      \n    # Bash commands to execute before compilation\n    # These commands will be executed once before all compilations\n    beforeBuild: []\n```\n\n### How does it work?\n\nThe plugin compiles every Go function defined in `serverless.yaml` into `.bin` directory. After that it internally changes `handler` so\nthat the Serverless Framework will deploy the compiled file not the source file.\n\nFor every matched function it also overrides `package` parameter to the next config:\n\n```yaml\nindividually: true\nartifact: <path to the generated zip with go binary>\n```\n\n### How to run Golang Lambda on ARM?\n\nChange architecture field from `provider` or function configuration to `arm64`:\n\n```yaml\nprovider:\n  architecture: 'arm64'\n  runtime: 'provided.al2023' # or provided.al2\n\n# If you define architecture at function level, this will have preference instead the provider configuration\n\nfunctions:\n  test:\n    architecture: 'arm64'\n    handler: test/main.go\n```\n\n### How to execute commands before compilation?\n\nYou can define bash commands to be executed before any compilation action using the `beforeBuild` configuration:\n\n```yaml\ncustom:\n  go:\n    beforeBuild:\n      - 'go generate ./...'\n      - 'go mod tidy'\n```\n\nThese commands will be executed once before all compilations, not for each function individually. This applies whether you're using `serverless deploy`, `serverless deploy function`, or `serverless invoke local`.\n\n## Caveats\n\nThis implementation doesn't allow to add any other files to the lambda artifact apart from the binary. To address this problem you should\nuse Lambda Layers to allow your lambdas to hold external files.\n\n## Credits\n\nThis repo is forked from [serverless-go-plugin][1] created by [mthenw][2] and modified to fix some issues and reach the new AWS standards\n(go1.x provider deprecation).\n\n[1]: https://github.com/mthenw/serverless-go-plugin\n[2]: https://github.com/mthenw\n","readmeFilename":"README.md"}