Fix deterministic template table index ordering #11
Reference in New Issue
Block a user
Delete Branch "fix/issue-10-deterministic-table-index"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the template writer path where
values .Table.Indexeswas backed by raw Go map iteration, causing repeated code generation from the same schema to emit indexes in different orders.Changes:
keys/valueshelper output, so generated template output no longer depends on Go map iteration order.Verification:
TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./pkg/writers/template -run TestWriterTableIndexValuesDeterministic -count=1TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./pkg/writers/template ./pkg/reflectutil -count=1TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./pkg/writers/... -count=1TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./... -count=1TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache make testgit diff --checkRefs #10