replace the horrible error system with multiple returns
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
func main[] : i64
|
||||
s : i64 = must(net.listen?(net.pack_addr(127, 0, 0, 1), 8000))
|
||||
~s, ok := net.listen(net.pack_addr(127, 0, 0, 1), 8000)
|
||||
if !ok
|
||||
panic("failed to listen")
|
||||
|
||||
io.println("Listening on port 8000...")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user