IsRoot changed to global variable
IsRoot changed to global variable. todo: change from int to bool.
This commit is contained in:
parent
fa81bedd90
commit
01df84aeba
@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
isroot int = 0
|
IsRoot int = 0
|
||||||
|
|
||||||
)
|
)
|
||||||
func chkroot(){
|
func chkroot(){
|
||||||
@ -19,7 +19,7 @@ func chkroot(){
|
|||||||
|
|
||||||
id1, err := strconv.Atoi(user.Uid) //converts uid to a int
|
id1, err := strconv.Atoi(user.Uid) //converts uid to a int
|
||||||
if id1 == 0 { //cheks if uid = 0
|
if id1 == 0 { //cheks if uid = 0
|
||||||
isroot = 1
|
IsRoot = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -29,5 +29,5 @@ func chkroot(){
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
chkroot()
|
chkroot()
|
||||||
fmt.Println(isroot)
|
fmt.Println(IsRoot)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user