O'Reilly logo

Go: Design Patterns for Real-World Projects by Mat Ryer, Mario Castro Contreras, Vladimir Vivien

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing our solution

Let's see whether our two programs play nicely together. You may want to open two terminal windows for this, since we'll be running two programs.

We have already added some paths to the database, so let's use backup to see them:

./backup -db="./backupdata" list

You should see the two test folders; if you don't, refer to the Adding paths section:

= ./test [Not yet archived]
= ./test2 [Not yet archived]

In another window, navigate to the backupd folder and create our two test folders, called test and test2.

Build backupd using the usual method:

go build -o backupd

Assuming all is well, we can now start the backup process, being sure to point the db path to the same path as we used for the backup program and specifying that we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required