Thank you, guys.  I walked myself into a logical trap.  Professor Isapovich 
is probably turning in his grave and giving me an F in some heavenly grade 
book.

On Monday, May 11, 2020 at 2:53:02 PM UTC-4, Saied Seghatoleslami wrote:
>
> I have seen a ticket on this topic (or something related to it) on Github 
> but I thought I would ask this community first:
>
> In first instance, I got "suspect or: role != admin || role != superadmin"
> In the second instance, it works just fine.  I have verified that role is 
> string type (with %T verb).
>
> since role can be admin, superadmin, or anything else for that matter, why 
> would the first case generate the suspect message, and the second case 
> works fine.
>
> I am running go version go1.13.4 darwin/amd64 on a Mac
>
>
> First Instance:
>
> const (
>  admin      = "admin"
>  superadmin = "superadmin"
> )
>
> invalidRole := role != admin || role != superadmin
>
>
>
> Second instance:
>
> const (
>  admin      = "admin"
>  superadmin = "superadmin"
> )
>
> validRole := role == admin || role == superadmin
>
>
>
>

-- 
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 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/b30582cf-01f2-4281-a11d-a6d2ed26dc6a%40googlegroups.com.

Reply via email to