Re: [go-nuts] suspect or: role != admin || role != superadmin

2020-05-11 Thread Ian Lance Taylor
On Mon, May 11, 2020 at 11:53 AM 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

Re: [go-nuts] suspect or: role != admin || role != superadmin

2020-05-11 Thread Kurtis Rader
The inverse of validRole := role == admin || role == superadmin is invalidRole := role != admin && role != superadmin or invalidRole := !(role == admin || role == superadmin) It is not invalidRole := role != admin || role != superadmin Think about it. No matter what value `role`

[go-nuts] suspect or: role != admin || role != superadmin

2020-05-11 Thread Saied Seghatoleslami
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