-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanups #103
Cleanups #103
Conversation
…will make it easier and safer to add new types (e.g. date and enum).
…h manually. This will make it easier and safer to add new values (e.g. date and enum).
…spath manually. This will make it easier and safer to add new values (e.g. date and enum).
… reduce the number of arguments passes, and name them. Also attaching functionality to the context for added convenience.
…lue rather than doing explicit type dispath manually. This will make it easier and safer to add new values (e.g. date and enum).
Included is #85. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 this is great.
return []*Worksheet{childWs} | ||
} | ||
if _, ok := value.(*Slice); ok { | ||
panic("slices-of-slices are not supported yet") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from #85
though when we merge, we should test slices of slices!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
figured I'd leave this as open since we have #32 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, makes sense. Didn't know about that one.
This introduces three functions on
Value
(and one onType
), to leverage go’s dynamic dispatch rather than rely on type switches. This will make it more natural to introduce adate
andenum
type, and will make the changes much more go compiler directed, vs relying on code inspection to feel confident the implementation is correct.There are more spots where we do type dispatch, and special handling, but they are mostly ref vs not-ref related, and would matter when we introduce a
map[x]y
type.Each commit in this PR is isolated, and meant to be reviewed by itself.