Re: [go-nuts] Re: Need help to figure out how to convert user.Current() to string.

2018-03-05 Thread andrey mirtchovski
> var testuser string = string(user.Username) you don't need the conversion. user.Username is already a string. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email

[go-nuts] Re: Need help to figure out how to convert user.Current() to string.

2018-03-05 Thread john . mizell
I figured out this issue. I was calling the struct and needed to call one specific element of the struct. Then I assign it to a string. user, err := user.Current() if err != nil { log.Fatal(err) } var testuser string = string(user.Username) if testuser == "root" || tes