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}
|
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
|
go mod download
|
||||||
else
|
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"
|
echo "Please update fission/go-builder and fission/go-env image to the latest version to support go module"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
# still need to do this; otherwise, go will complain "cannot find main module".
|
|
||||||
go mod init
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
go build -buildmode=plugin -i -o ${DEPLOY_PKG} .
|
go build -buildmode=plugin -i -o ${DEPLOY_PKG} .
|
||||||
|
|||||||
Reference in New Issue
Block a user