ERROR - Building to deploy to Lambda, please help

hi all

Build a routine to post to Confluent Kafka, 1.20.x
when run locally it (go run main.go) works, when i go go build main.go it compiles,
BUT when i make deploy using below, it fails, any ideas?



export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
.DEFAULT_GOAL := deploy

	go build -o ${BINARY_NAME} .
	zip -r main
	aws lambda update-function-code --function-name "S3JSONDecomposer-Golang" --zip-file fileb:// --region="af-south-1" | jq . 

END Makefile

go build -o main .
# jsondecomposer
./main.go:130:14: undefined: kafka.ConfigMap
./main.go:142:25: undefined: kafka.NewProducer
make: *** [deploy] Error 1

I mention again go run main.go works, go mod init and go mod init has been run.
go build -o main works as well as go build .
it seems to crash when the above makefile is executed.
PS this is being build on a M1 based MAC, but before anyone says that’s the problem, I’ve copied the code to a amazon linux machine and done the exact same with the exact same results.