Fix go 1.9.2 & 1.11.4 shows "go mod not found" (#1276)
This commit is contained in:
@@ -22,16 +22,18 @@ fi
|
||||
|
||||
cd ${srcDir}
|
||||
|
||||
if [ -f "go.mod" ]; then
|
||||
if [ ! -z ${GOLANG_VERSION} ] && version_ge ${GOLANG_VERSION} "1.12"; then
|
||||
if [ ! -z ${GOLANG_VERSION} ] && version_ge ${GOLANG_VERSION} "1.12"; then
|
||||
if [ -f "go.mod" ]; then
|
||||
go mod download
|
||||
else
|
||||
# still need to do this; otherwise, go will complain "cannot find main module".
|
||||
go mod init
|
||||
fi
|
||||
else # go version lower than go 1.12
|
||||
if [ -f "go.mod" ]; then
|
||||
echo "Please update fission/go-builder and fission/go-env image to the latest version to support go module"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# still need to do this; otherwise, go will complain "cannot find main module".
|
||||
go mod init
|
||||
fi
|
||||
|
||||
go build -buildmode=plugin -i -o ${DEPLOY_PKG} .
|
||||
|
||||
Reference in New Issue
Block a user