This commit is contained in:
2024-03-31 10:02:00 -05:00
parent ef964fc04e
commit 529d38db9f
4 changed files with 21 additions and 16 deletions

18
scripts/golang-build.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
#%%MULTILINE_YAML_START
#Build golang project
export GOPATH=/go
export PATH=$PATH:$GOPATH/bin
mkdir output
go install
# Check if go.mod contains "swag"
if grep -q "swag" go.mod; then
echo "Found 'swag' in go.mod. Running swag init..."
go install github.com/swaggo/swag/cmd/swag@v1.8.12
swag init
fi
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ./output/main .