www/content/resources/errors/no-main.md
This usually happens if you're trying to build a library or if you didn't setup
the builds.main section in your .goreleaser.yaml and your main.go is not
in the root directory.
Here's an example error:
⨯ build failed after 0.11s error=build for foo does not contain a main function
Learn more at https://goreleaser.com/errors/no-main
Add something like this to your config:
builds:
- skip: true
main.go is not in the root directoryAdd something like this to your config:
builds:
- main: ./path/to/your/main/pkg/
For more info, check the builds documentation.
Run goreleaser in the root of the project.
plugin, c-shared or c-archive build modesYou can set no_main_check to true:
builds:
- main: ./path/...
buildmode: plugin
no_main_check: true
For more info, check the builds documentation.