github.com/ulule/limiter/v3@v3.11.3-0.20230613131926-4cb9c1da4633/scripts/test (about)

     1  #!/bin/bash
     2  
     3  if [[ ! -x "$(command -v go)" ]]; then
     4    echo >&2 "go runtime is required: https://golang.org/doc/install"
     5    echo >&2 "You can use scripts/go-wrapper $0 to use go in a docker container."
     6    exit 1
     7  fi
     8  
     9  SOURCE_DIRECTORY=$(dirname "${BASH_SOURCE[0]}")
    10  cd "${SOURCE_DIRECTORY}/.."
    11  
    12  if [ -z "$REDIS_DISABLE_BOOTSTRAP" ]; then
    13      export REDIS_URI="redis://localhost:26379/1"
    14      scripts/redis --restart
    15  fi
    16  
    17  go test -count=1 -race -v $(go list ./... | grep -v -E '\/(vendor|examples)\/')