From b5c292bae9c9b1ea188ba300775a5e28d80829f9 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 20 Sep 2015 21:59:39 +0300 Subject: [PATCH] Preset destination value is dangerous --- syncer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/syncer.go b/syncer.go index 3d96ccd..3a9e68a 100644 --- a/syncer.go +++ b/syncer.go @@ -35,7 +35,7 @@ import ( var ( blkSize = flag.Int64("blk", 2*1<<10, "Block size (KiB)") statePath = flag.String("state", "state.bin", "Path to statefile") - dstPath = flag.String("dst", "/dev/ada0", "Path to destination disk") + dstPath = flag.String("dst", "", "Path to destination disk") srcPath = flag.String("src", "/dev/da0", "Path to source disk") ) @@ -54,6 +54,10 @@ func main() { flag.Parse() bs := *blkSize * int64(1<<10) + if *dstPath == "" { + log.Fatalln("Not destination is specified") + } + // Open source, calculate number of blocks var size int64 src, err := os.Open(*srcPath) -- 2.44.0