2 ms·
Ok Considered Harmful
- benhoyt 2y agoI don't find the fixed code "better in every way". The ultra-long names are hard to read, partly because they take up a lot of space and move the important part -- the GetTable() call -- further right: var err error var leftSideTableExists tm.leftTbl, leftSideTableExists, err = rm.left.GetTable(...) if err != nil { ... } if leftSideTableExists { ... } Plus, the code explicitly defines the variables with "var" instead of ":=", making it more verbose, and it overwrites tm.leftTbl even if GetTable returns an error (doesn't matter in this case as tm is locally-created, but is often not desired). I'd probably just call it "exists", but if you do want to distinguish left-exists and right-exists, I'd use "leftExists"; "side" and "table" are obvious from the context: left, leftExists, err := rm.left.GetTable(...) if err != nil { ... } if leftExists { ... } tm.leftTbl = left