Skip to content

valast: slice got turns to different output than non-slice #5

@fabstu

Description

@fabstu

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: "def",
			C: valast.Addr(false).(*bool),
			D: valast.Addr(true).(*bool),
		}})},
	}

while a non-slice got does not wrap on every comma

	tests := []struct {
		name string
		want autogold.Value
	}{
		{name: "good", want: autogold.Want("good", A{
			A: valast.Addr("abc").(*string), B: "def", C: valast.Addr(false).(*bool),
			D: valast.Addr(true).(*bool),
		})},
	}

. I think it would be nice for non-slice wants to also wrap them on every comma. I know this is a small thing, so may not be worth it. It may also be more compact to keep it the current way. But I'd love an option to have it both the same output style - the slice-way.

I hope this is something you want input about. I thought I mention it before it is in wider use and more difficult to change. :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions