github.com/artpar/rclone@v1.67.3/bin/use-deadlock-detector (about)

     1  #!/bin/bash
     2  
     3  if [[ ! -z $(git status --short --untracked-files=no) ]]; then
     4     echo "Detected uncommitted changes - commit before running this"
     5     exit 1
     6  fi
     7  
     8  echo "Installing deadlock detector - use 'git reset --hard HEAD' to undo"
     9  
    10  go get -v github.com/sasha-s/go-deadlock/...
    11  find . -type f -name "*.go" -print0 | xargs -0 sed -i~ 's/sync.RWMutex/deadlock.RWMutex/; s/sync.Mutex/deadlock.Mutex/;'
    12  goimports -w .
    13  
    14  echo "Done"