Go Programming Experience

Novice

Other Languages Experience

Go, C/C++

Related Idea

  • [x] Has this idea, or one like it, been proposed before?
  • [X] Does this affect error handling?
  • [x] Is this about generics?
  • [x] Is this change backward compatible? Breaking the Go 1 compatibility guarantee is a large cost and requires a large benefit

Has this idea, or one like it, been proposed before?

No

Does this affect error handling?

No. But, caused error is an interface, this will make more simple to check.

Is this about generics?

No

Proposal

we need to simplify if condition for pointer nil checking.

var err error =  nil
if err != nil {
   // do somethings
}

my expectation is:

var err error =  nil
if err {
   // error handling
}

Language Spec Changes

No response

Informal Change

No response

Is this change backward compatible?

Not sure, but i think will not compatible.

Orthogonality: How does this change interact or overlap with existing features?

No response

Would this change make Go easier or harder to learn, and why?

more harder to learn. But, more easier to code.

Cost Description

No response

Changes to Go ToolChain

gofmt, gopls will affected

Performance Costs

No response

Prototype

No response

Comment From: gabyhelp

Similar Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)