8000 Add IsComputed helper for field by pratikprasad · Pull Request #139 · homelight/worksheets · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add IsComputed helper for field #139

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

Merged
merged 3 commits into from
Nov 26, 2018

Conversation

pratikprasad
Copy link
Contributor

No description provided.

@alexandrinaw
Copy link
Contributor

Could you please add tests?

Could you also add more of a description to the PR? I'm struggling to figure out what this is for or how it would be useful.

@pratikprasad pratikprasad force-pushed the Add-helper-for-field-is-computed branch 2 times, most recently from fa6ae09 to a36a9bb Compare November 26, 2018 19:12
@pratikprasad
Copy link
Contributor Author

Added a better commit message and a test. The only real use case is so that I can use Unpack for structs that have computed fields. Unpack lives in the other repo - and we're currently not able to skip over copying fields that are computed since that information is encapsulated.

A helper function on the `Field` type so that unpacking a struct into a worsheet can avoid manipulating fields that should just be computed
@pratikprasad pratikprasad force-pushed the Add-helper-for-field-is-computed branch from a36a9bb to 07c151a Compare November 26, 2018 19:16

"github.com/helloeave/dat/sqlx-runner"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestField_IsComputedBy(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this part of the Zuite

"github.com/helloeave/dat/sqlx-runner"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"math"
"strings"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like these are in the wrong spot now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬 Sorry, I should have just run goimports...

@pratikprasad pratikprasad merged commit d060758 into master Nov 26, 2018
@lgonzalez-silen lgonzalez-silen deleted the Add-helper-for-field-is-computed branch November 27, 2018 15:40
@lgonzalez-silen
Copy link
Contributor

@pratikprasad you can't skip by specifying ws:"-"?

@lgonzalez-silen
Copy link
Contributor

@pratikprasad you can't skip by specifying ws:"-"?

nvm @alexandrinaw explained to me that this is in the other conversion direction. let ws do its thing basically, chuck the struct's value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0