github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/entry-dev.sh (about)

     1  #!/bin/sh
     2  cd /janus
     3  if [ "$debug" == 1 ]; then
     4    echo "about to compile go for debugging"
     5    go build -gcflags "all=-N -l" -o main .
     6  else
     7    echo "about to compile go"
     8    CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
     9  fi
    10  echo "compile finished"
    11  if [ "$debug" == 1 ]; then
    12    dlv --listen=:40000 --headless=true --continue --accept-multiclient --api-version=2 exec ./main start
    13  else
    14    ./main start
    15  fi