Y
Hacker News
new
|
ask
|
show
|
jobs
by
philosopher1234
1097 days ago
They're not reserved keywords. Existing/package defined min/max functions would take precedence. They have the same semantics as `append`
1 comments
WhereIsTheTruth
1097 days ago
You refactored your code, you think you wrote your ``min`` function, but no, it'll call the builtin one, without warning you..
I don't like this design..
link
vito
1097 days ago
The compiler will tell you if the types aren't compatible, and this is only for primitive comparable types. What `min()` implementation could you have that even does something different?
link
KRAKRISMOTT
1097 days ago
A heap?
link
Chiron1991
1097 days ago
Not too familiar with go toolchains, but I bet there's a linter that will warn you about shadowing builtins.
link
Mawr
1097 days ago
Yep: "variable append has same name as predeclared identifier (predeclared) go-golangci-lint"
link
bananapub
1097 days ago
if you have so few tests and so little code review that this matters then I am not sure what to suggest
link
dgfitz
1097 days ago
Qt uses qMin and qMax, it may have been nice if go went with like gMin and gMax
link
I don't like this design..