autogold
autogold copied to clipboard
Automatically update your Go tests
I think we can eliminate the need for supplying a unique name to `autogold.Want` by instead using the call stack information, i.e. since Go programs embed debugging information we know...
I think `-update-only` may be a lot faster in general because it doesn't need to shuffle files around in order to remove unused `.golden` files (although that _should_ be fairly...
See this example: ``` tests := []struct { name string want autogold.Value }{ {name: "good", want: autogold.Want("good", []A{A{ A: valast.Addr("abc").(*string), B: "def", C: valast.Addr(false).(*bool), D: valast.Addr(true).(*bool), }})}, } ``` `[]A{A{`...
A small example: A slice got wraps the want-struct on each comma, ``` tests := []struct { name string want autogold.Value }{ {name: "good", want: autogold.Want("good", []A{A{ A: valast.Addr("abc").(*string), B:...
Thank you so much for writing this utility ! I have a field in my struct that is transient. Meaning it gets generated from random values. I don't want to...
I got this result when running with `-update` flag:  one of them generated with `"` the other one with backtick, is there a way to make it consistent one...
Right now the generated assertions for some pointer types use `valast.Addr` to get an `interface{}` that then gets cast back into the desired type. It's quite a lot of casting...
Background: saving to database and generating the result giving different diff because of timezone difference minimal code to reproduce: ```go package foo import "time" import "github.com/hexops/autogold" import "testing" func TestFoo(t...
When a codebase has packages that do not use `autogold`, running `go test ./... -update` causes the test run to fail with a usage message. The usage message is shown...