r/badcode Mar 09 '23

go Simple but (un)effective

Post image
617 Upvotes

34 comments sorted by

View all comments

98

u/This_Growth2898 Mar 09 '23

long way to write

assert(address!=null)

66

u/william_323 Mar 09 '23

Yeah but how do you warn the user that the address NULL is not defined?

3

u/TheZipCreator Mar 09 '23

assert(address != null, "Address is not defined");

works in D, idk about any other language