(no title)
guy4261 | 2 years ago
Coming from Python, I got used to the "explicit is better than implicit" Zen. With "import *" being discouraged, usually when you see something in your Python code, you know exactly where it came from. When I started out with golang, seeing references to things that came out of nowhere (to my eyes) annoyed the hell out of me. I still consider this a cognitive burden.
w7|2 years ago
Generally in Go: functions, structs, and consts are namespaced in a way I think is familiar to most, by package origin.
If something is not, then it's either a function/struct in the same namespace (same file, or directory), variable in same scope, or it's a built-in.
Built-ins like `append`, are not much different than say `map`, `filter`, `max`, etc in Python.
Anything sourced from a subdirectory, parent directory, or sibling directory needs to be explicitly imported via the module path.
knome|2 years ago
lanstin|2 years ago