Hey! I have been trying to figure it out how to build my Go functions. And almost getting the following error when I run: netlify build:
────────────────────────────────────────────────────────────────
2. Functions bundling
────────────────────────────────────────────────────────────────
No Functions were found in functions directory
(Functions bundling completed in 110ms)
$ tree functions
/Users/furkan.turkal/go/src/myapp/functions
├── api
├── go.mod
├── go.sum
└── sserver
└── main.go
My netlify.toml config:
[build]
base = "./"
command = "pushd web3/ && npm run build && npm run export && popd && pushd functions/ && go build -o api ./server"
publish = "web3/out/"
functions = "functions"
[build]
base = "./"
command = "pushd web3/ && npm run build && npm run export && popd && pushd functions/ && go build -o api ./server && popd"
publish = "web3/out/"
[build.environment]
GO_IMPORT_PATH = "github.com/Dentrax/myapp/functions"
[functions]
directory = "functions/"
My go.mod:
module github.com/Dentrax/myapp/functions
Deploying to draft URL...
✔ Finished hashing 19 files and 0 functions
My dirs:
❯ netlify functions:list
No functions found in /Users/furkan.turkal/go/src/myapp/functions
❯ netlify functions:invoke
◈ "port" flag was not specified. Attempting to connect to localhost:8888 by default
? Pick a function to trigger (Use arrow keys)
❯ ls functions
api go.mod go.sum server
────────────────────────────────────────────────────────────────
1. build.command from netlify.toml
────────────────────────────────────────────────────────────────
$ cd ./functions && go build -o api ./server
(build.command completed in 9.7s)
────────────────────────────────────────────────────────────────
2. Functions bundling
────────────────────────────────────────────────────────────────
No Functions were found in functions directory
(Functions bundling completed in 155ms)
Created a proposal by debugging Netlify build system end-to-end. Might need some help to improve Go documentation: Build functions | Netlify Docs according to maintainers feedback.