From a9206c8d357799224aa592b69c60141ffccff5c7 Mon Sep 17 00:00:00 2001 From: zijiren233 Date: Thu, 5 Oct 2023 17:47:02 +0800 Subject: [PATCH] Fix: disable cgo --- build.sh | 9 +++++---- server/handlers/api-movie.go | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 547d871..d064652 100644 --- a/build.sh +++ b/build.sh @@ -21,6 +21,7 @@ function Help() { } function Init() { + CGO_ENABLED=0 VERSION="dev" WEB_VERSION="" commit="$(git log --pretty=format:"%h" -1)" @@ -178,9 +179,9 @@ function Build() { EXT="" fi 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 - 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 if [ $? -ne 0 ]; then echo "build $GOOS/$GOARCH error" @@ -198,9 +199,9 @@ function BuildSingle() { fi echo "build $GOOS/$GOARCH" 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 - 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 if [ $? -ne 0 ]; then echo "build $GOOS/$GOARCH error" diff --git a/server/handlers/api-movie.go b/server/handlers/api-movie.go index ceaf061..b4b68ff 100644 --- a/server/handlers/api-movie.go +++ b/server/handlers/api-movie.go @@ -564,7 +564,6 @@ func JoinLive(ctx *gin.Context) { fileExt := path.Ext(pullKey) channelName := strings.TrimSuffix(fileName, fileExt) m, err := user.Room().GetMovieWithPullKey(channelName) - // channel, err := s.GetChannelWithApp(r.ID(), channelName) if err != nil { ctx.AbortWithStatusJSON(http.StatusNotFound, NewApiErrorResp(err)) return