Daniel Nephin

Results 312 comments of Daniel Nephin

Oh, why is that? Do you get an error?

Ah, yes that makes sense. Unfortunately I don't think changing it to `go list ./...` works. The variable that captures the value requires a single path, not a list. One...

My understanding is that the args passed to this script (`$@`) will be a list of paths to files. So `echo $@|xargs -n1 dirname|sort -u` files all the paths to...

Hmm, right, I forget that "accepts files" does not mean the files can be in separate packages. This sounds similar to #47, #62, #63, but for `go generate` instead of...

Isn't it possible to do this directly with pre-commit?

There have been a number of PRs opened to fix/improve the govet hook. My latest recommendation [is here](https://github.com/dnephin/pre-commit-golang/pull/47#issuecomment-695854564). If you want to run `go vet` on all files, I think...

> If you're just trying to ignore a single struct field, does `cmpopts.IgnoreFields` suit your needs? I would like to avoid having to ignore it. I want to use a...

Ah yes, I see what you mean. I think generally these failures to match would be obvious when the test fails, but probably not easy to debug. Don't you still...

I looked around `cmpopts` a bit and found `filterField`, which would perfect: https://github.com/google/go-cmp/blob/0c93777250bd58222171888d1651979319d8b381/cmp/cmpopts/struct_filter.go#L15-L28 This is much better than having to define the entire path, and should be type safe. What's...

Thanks for the explanation. My initial reaction is: **1. Returning only func(cmp.Path) bool and func(interface{}) bool doesn't compose well** To provide a filter of both path and values why not...