From 01df84aebaad6515d763f7d0cb1db425a6367f6a Mon Sep 17 00:00:00 2001 From: Morrigan Date: Sun, 24 Mar 2019 19:41:01 -0700 Subject: [PATCH] IsRoot changed to global variable IsRoot changed to global variable. todo: change from int to bool. --- rootchk.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rootchk.go b/rootchk.go index 6f04358..8aa68f7 100644 --- a/rootchk.go +++ b/rootchk.go @@ -8,7 +8,7 @@ import ( ) var ( -isroot int = 0 +IsRoot int = 0 ) func chkroot(){ @@ -19,7 +19,7 @@ func chkroot(){ id1, err := strconv.Atoi(user.Uid) //converts uid to a int if id1 == 0 { //cheks if uid = 0 - isroot = 1 + IsRoot = 1 } @@ -29,5 +29,5 @@ func chkroot(){ func main() { chkroot() -fmt.Println(isroot) +fmt.Println(IsRoot) }