Fix: disable cgo

pull/8/head
zijiren233 2 years ago
parent af47eb8126
commit a9206c8d35

@ -21,6 +21,7 @@ function Help() {
} }
function Init() { function Init() {
CGO_ENABLED=0
VERSION="dev" VERSION="dev"
WEB_VERSION="" WEB_VERSION=""
commit="$(git log --pretty=format:"%h" -1)" commit="$(git log --pretty=format:"%h" -1)"
@ -178,9 +179,9 @@ function Build() {
EXT="" EXT=""
fi fi
if [ "$TRIM_PATH" ]; then if [ "$TRIM_PATH" ]; then
GOOS=$GOOS GOARCH=$GOARCH go build -trimpath -tags "$TAGS" -ldflags "$LDFLAGS" -o "$BUILD_DIR/$(basename $PWD)-$GOOS-$GOARCH$EXT" . CGO_ENABLED=$CGO_ENABLED GOOS=$GOOS GOARCH=$GOARCH go build -trimpath -tags "$TAGS" -ldflags "$LDFLAGS" -o "$BUILD_DIR/$(basename $PWD)-$GOOS-$GOARCH$EXT" .
else else
GOOS=$GOOS GOARCH=$GOARCH go build -tags "$TAGS" -ldflags "$LDFLAGS" -o "$BUILD_DIR/$(basename $PWD)-$GOOS-$GOARCH$EXT" . CGO_ENABLED=$CGO_ENABLED GOOS=$GOOS GOARCH=$GOARCH go build -tags "$TAGS" -ldflags "$LDFLAGS" -o "$BUILD_DIR/$(basename $PWD)-$GOOS-$GOARCH$EXT" .
fi fi
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "build $GOOS/$GOARCH error" echo "build $GOOS/$GOARCH error"
@ -198,9 +199,9 @@ function BuildSingle() {
fi fi
echo "build $GOOS/$GOARCH" echo "build $GOOS/$GOARCH"
if [ "$TRIM_PATH" ]; then if [ "$TRIM_PATH" ]; then
go build -trimpath -tags "$TAGS" -ldflags "$LDFLAGS" -o "$BUILD_DIR/$(basename $PWD)$EXT" . CGO_ENABLED=$CGO_ENABLED go build -trimpath -tags "$TAGS" -ldflags "$LDFLAGS" -o "$BUILD_DIR/$(basename $PWD)$EXT" .
else else
go build -tags "$TAGS" -ldflags "$LDFLAGS" -o "$BUILD_DIR/$(basename $PWD)$EXT" . CGO_ENABLED=$CGO_ENABLED go build -tags "$TAGS" -ldflags "$LDFLAGS" -o "$BUILD_DIR/$(basename $PWD)$EXT" .
fi fi
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "build $GOOS/$GOARCH error" echo "build $GOOS/$GOARCH error"

@ -564,7 +564,6 @@ func JoinLive(ctx *gin.Context) {
fileExt := path.Ext(pullKey) fileExt := path.Ext(pullKey)
channelName := strings.TrimSuffix(fileName, fileExt) channelName := strings.TrimSuffix(fileName, fileExt)
m, err := user.Room().GetMovieWithPullKey(channelName) m, err := user.Room().GetMovieWithPullKey(channelName)
// channel, err := s.GetChannelWithApp(r.ID(), channelName)
if err != nil { if err != nil {
ctx.AbortWithStatusJSON(http.StatusNotFound, NewApiErrorResp(err)) ctx.AbortWithStatusJSON(http.StatusNotFound, NewApiErrorResp(err))
return return

Loading…
Cancel
Save