From 3269bc539e52cdced8c03a628e4fdf22942ece4b Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Thu, 19 Oct 2017 03:37:54 -0700 Subject: util: Add CheckIfRoot Replace IsUserRoot with CheckIfRoot. This allows all functions to use the same error handling when a user is not root. --- util/errors.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util/errors.go') diff --git a/util/errors.go b/util/errors.go index fada687..f0b9403 100644 --- a/util/errors.go +++ b/util/errors.go @@ -29,6 +29,8 @@ import ( ) var ( + // ErrNotRoot indicates the action is restricted to the superuser. + ErrNotRoot = errors.New("only root can perform this action") // ErrSkipIntegration indicates integration tests shouldn't be run. ErrSkipIntegration = errors.New("skipping integration test") ) -- cgit v1.2.3