1
0
mirror of https://github.com/rclone/rclone.git synced 2025-01-13 20:38:12 +02:00
rclone/bin/use-deadlock-detector
2024-03-10 11:22:43 +00:00

15 lines
427 B
Bash
Executable File

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