BLUE
Profile banner
DT
Dmitry Tantsur
@creepy-owlet.mastodon.online.ap.brid.gy
Working on Ironic for OpenShift and sometimes OpenStack, maintaining openstack/osauth rust crates. FOSS, hiking, camping, bouldering and music. An owl from […] [bridged from mastodon.online/@creepy_owlet on the fediverse by fed.brid.gy/ ]
0 followers0 following49 posts

My teammate just spent a couple of days to discover a #golang idiosyncrasy: the := operator will shadow variables from outer scopes. E.g. this code will print true, then false: var value bool { value, str := return_bool_and_hello() fmt.Printf("value is %+v, string is %s\n", value, str) } fmt […]

1

It also means that these functions return different values: func get_value() (value bool) { value, str := return_bool_and_hello() fmt.Printf("value is %+v, string is %s\n", value, str) return } and func get_value() (value bool) { { value, str := return_bool_and_hello() fmt.Printf("value is […]

0
Profile banner
DT
Dmitry Tantsur
@creepy-owlet.mastodon.online.ap.brid.gy
Working on Ironic for OpenShift and sometimes OpenStack, maintaining openstack/osauth rust crates. FOSS, hiking, camping, bouldering and music. An owl from […] [bridged from mastodon.online/@creepy_owlet on the fediverse by fed.brid.gy/ ]
0 followers0 following49 posts