You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Visual clutter of defer func() { _ = src.Close()}() is distracting, but if there's no plan to fix the go compiler to be more optimal, it could be better to handle this manually with a trailing comment of the issue left unsolved.
ex.
deferfunc() { _=src.Close()}() // wrap manually to avoid assembly bloat until goland/go#12356
In func-e, this may be less important, but we should be considerate that this one is more than just style.
The text was updated successfully, but these errors were encountered:
At least in go 1.17 amd64, there's a lot more assembly generated by the compiler for
vs doing it explicitly like this:
Note:
src.Close()
and_ = src.Close()
make the same assembly.https://godbolt.org/z/KP4q1WTah
Visual clutter of
defer func() { _ = src.Close()}()
is distracting, but if there's no plan to fix the go compiler to be more optimal, it could be better to handle this manually with a trailing comment of the issue left unsolved.ex.
In func-e, this may be less important, but we should be considerate that this one is more than just style.
The text was updated successfully, but these errors were encountered: