I'm trying to deploy a function to GCF but it's failing no matter what I try. This is the error returned every time:
Build failed: 2021/03/02 18:02:46 Unable to extract package name: unable to find Go package in /workspace/serverless_function_source_code.
exit status 1; Error ID: aba1aa6a
I've read a few answers here and I tried to fix the issue as told, but I keep having this error and I'm lost at this point.
My project structure is as follow:
.
|--function.go
|--go.mod
|--go.sum
|--subpackage
` |--subpackage.go
My main function uses some stuff from subpackage.go and the function.go import is:
package function
import (
"fmt"
"log"
"net/http"
// remote imports //
modname/subpackage
)
and then the go.mod file:
module modname
go 1.13
require (
// remote imports //
modname/subpackage
)
The subpackage is initialized as package subpackage and I think this is what the GCF docs say.
In function.go I have a function called Start that I indicated as the entrypoint in the setup. I'm lost and I have no idea how to work around this.