github.com/waldiirawan/apm-agent-go/v2@v2.2.2/scripts/moduledirs.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # Print the module directories. If modules are disabled or unsupported
     4  # by the installed Go toolchain, then just print the current working
     5  # directory (assumed to be the repo top level.)
     6  if test -z "$(go env GOMOD)"; then
     7      pwd
     8  else
     9      find . -type f -name go.mod -exec dirname '{}' \;
    10  fi