attic-labs / noms

The versioned, forkable, syncable database
Apache License 2.0
7.45k stars 267 forks source link

Enable to stop in struct's IterFields method #3813

Closed sairoutine closed 5 years ago

sairoutine commented 5 years ago

As well as list and map, I would like to write the following the code by struct's iteration method.

var error err
str.IterFields(func(name string, value types.Value) bool {
    err = SomeMethod()
    if err != nil {
        return true
    }
    return false
})

if err != nil {
    return err
}
sairoutine commented 5 years ago

I finished the agreement.

sairoutine commented 5 years ago

It seems that it is not the matter of this pull request that fails the test of Travis.

sairoutine commented 5 years ago

@aboodman Thank you for your review. I finished fixing your pointed out. Please review again.

arv commented 5 years ago

Wasn't there some performance issues with assert.Equal?

aboodman commented 5 years ago

@arv is right - I forgot about that perf issue. I will land the version of the change that you originally posted.

Thanks for the patch!

aboodman commented 5 years ago

Actually the usage here is in a test file, so the perf is irrelevant. Landed as-is.

sairoutine commented 5 years ago

Thank you for your merging!