Skip to content

Commit

Permalink
tests: update golden files
Browse files Browse the repository at this point in the history
  • Loading branch information
michenriksen committed Oct 18, 2023
1 parent 0cdb87e commit a8faa63
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 54 deletions.
13 changes: 8 additions & 5 deletions testdata/golden/parser_default-options.golden
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package mypackage

// MyExportedType is an exported custom type.
type MyExportedType int

// MyFunctionType is a function type that takes two integers and returns a
// boolean.
type MyFunctionType func(int, int) bool

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}

// MyStruct is a struct with exported and unexported fields.
type MyStruct struct {
ExportedField int // exported field.
Expand All @@ -25,8 +33,3 @@ func MyThirdFunction() MyFunctionType

// NewMyStruct is an example constructor function for [MyStruct]
func NewMyStruct(n int) (*MyStruct, error)

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}
10 changes: 6 additions & 4 deletions testdata/golden/parser_exclude-doc-comments.golden
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
package mypackage

type MyExportedType int

type MyFunctionType func(int, int) bool

type MyInterface interface {
MyMethod() error
}

type MyStruct struct {
ExportedField int
}
Expand All @@ -15,7 +21,3 @@ func MyOtherFunction(s string, cb func(string) bool) bool
func MyThirdFunction() MyFunctionType

func NewMyStruct(n int) (*MyStruct, error)

type MyInterface interface {
MyMethod() error
}
16 changes: 8 additions & 8 deletions testdata/golden/parser_exclude-func-types.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
package mypackage

// MyExportedType is an exported custom type.
type MyExportedType int

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}

// MyStruct is a struct with exported and unexported fields.
type MyStruct struct {
ExportedField int // exported field.
Expand All @@ -16,13 +24,5 @@ func MyFunction(a, b int) bool
// [MyFunctionType].
func MyOtherFunction(s string, cb func(string) bool) bool

// MyThirdFunction returns a function type.
func MyThirdFunction() MyFunctionType

// NewMyStruct is an example constructor function for [MyStruct]
func NewMyStruct(n int) (*MyStruct, error)

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}
13 changes: 8 additions & 5 deletions testdata/golden/parser_exclude-funcs.golden
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package mypackage

// MyExportedType is an exported custom type.
type MyExportedType int

// MyFunctionType is a function type that takes two integers and returns a
// boolean.
type MyFunctionType func(int, int) bool

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}

// MyStruct is a struct with exported and unexported fields.
type MyStruct struct {
ExportedField int // exported field.
}

// MyMethod is a method associated with MyStruct.
func (s MyStruct) MyMethod()

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}
3 changes: 3 additions & 0 deletions testdata/golden/parser_exclude-interfaces.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package mypackage

// MyExportedType is an exported custom type.
type MyExportedType int

// MyFunctionType is a function type that takes two integers and returns a
// boolean.
type MyFunctionType func(int, int) bool
Expand Down
16 changes: 11 additions & 5 deletions testdata/golden/parser_exclude-regexp.golden
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package mypackage

// MyExportedType is an exported custom type.
type MyExportedType int

// MyFunctionType is a function type that takes two integers and returns a
// boolean.
type MyFunctionType func(int, int) bool

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}

// MyStruct is a struct with exported and unexported fields.
type MyStruct struct {
ExportedField int // exported field.
Expand All @@ -17,6 +25,9 @@ func (s MyStruct) MyMethod()
// myUnexportedMethod is an example unexported method.
func (s MyStruct) myUnexportedMethod(a, b string) string

// myUnexportedType is an unexported custom type.
type myUnexportedType string

// MyFunction is an example function that takes two integers as input and
// returns a boolean result.
func MyFunction(a, b int) bool
Expand All @@ -33,8 +44,3 @@ func MyThirdFunction() MyFunctionType

// NewMyStruct is an example constructor function for [MyStruct]
func NewMyStruct(n int) (*MyStruct, error)

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}
16 changes: 8 additions & 8 deletions testdata/golden/parser_exclude-structs.golden
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package mypackage

// MyExportedType is an exported custom type.
type MyExportedType int

// MyFunctionType is a function type that takes two integers and returns a
// boolean.
type MyFunctionType func(int, int) bool

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}

// MyFunction is an example function that takes two integers as input and
// returns a boolean result.
func MyFunction(a, b int) bool
Expand All @@ -14,11 +22,3 @@ func MyOtherFunction(s string, cb func(string) bool) bool

// MyThirdFunction returns a function type.
func MyThirdFunction() MyFunctionType

// NewMyStruct is an example constructor function for [MyStruct]
func NewMyStruct(n int) (*MyStruct, error)

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}
16 changes: 10 additions & 6 deletions testdata/golden/parser_full-doc-comments.golden
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package mypackage

// MyExportedType is an exported custom type.
type MyExportedType int

// MyFunctionType is a function type that takes two integers and returns a
// boolean.
type MyFunctionType func(int, int) bool

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}

// MyStruct is a struct with exported and unexported fields.
type MyStruct struct {
ExportedField int // exported field.
Expand Down Expand Up @@ -35,16 +43,12 @@ func (s MyStruct) MyMethod()
// true if the integers are equal, false otherwise.
func MyFunction(a, b int) bool

// MyOtherFunction is an exported function that does not match [MyFunctionType].
// MyOtherFunction is an exported function that does not match
// [MyFunctionType].
func MyOtherFunction(s string, cb func(string) bool) bool

// MyThirdFunction returns a function type.
func MyThirdFunction() MyFunctionType

// NewMyStruct is an example constructor function for [MyStruct]
func NewMyStruct(n int) (*MyStruct, error)

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}
26 changes: 16 additions & 10 deletions testdata/golden/parser_include-unexported.golden
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package mypackage

// MyExportedType is an exported custom type.
type MyExportedType int

// MyFunctionType is a function type that takes two integers and returns a
// boolean.
type MyFunctionType func(int, int) bool

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}

// MyStruct is a struct with exported and unexported fields.
type MyStruct struct {
ExportedField int // exported field.
Expand All @@ -17,6 +25,14 @@ func (s MyStruct) MyMethod()
// myUnexportedMethod is an example unexported method.
func (s MyStruct) myUnexportedMethod(a, b string) string

// myUnexportedInterface is an unexported interface.
type myUnexportedInterface interface {
AnotherMethod(string, int, MyFunctionType) (n int, err error)
}

// myUnexportedType is an unexported custom type.
type myUnexportedType string

// MyFunction is an example function that takes two integers as input and
// returns a boolean result.
func MyFunction(a, b int) bool
Expand All @@ -33,13 +49,3 @@ func MyThirdFunction() MyFunctionType

// NewMyStruct is an example constructor function for [MyStruct]
func NewMyStruct(n int) (*MyStruct, error)

// MyInterface is an interface with a single method.
type MyInterface interface {
MyMethod() error
}

// myUnexportedInterface is an unexported interface.
type myUnexportedInterface interface {
AnotherMethod(string, int, MyFunctionType) (n int, err error)
}
3 changes: 0 additions & 3 deletions testdata/golden/parser_only-and-exclude-regexp.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ package mypackage
// MyFunction is an example function that takes two integers as input and
// returns a boolean result.
func MyFunction(a, b int) bool

// MyThirdFunction returns a function type.
func MyThirdFunction() MyFunctionType

0 comments on commit a8faa63

Please sign in to comment.