Skip to content

Nested Structs and non primitive type support

Compare
Choose a tag to compare
@mariotoffia mariotoffia released this 06 Oct 16:56
· 113 commits to master since this release

Now it supports both nested structs and typedefs where the type is of struct kind like time.Time.

// MyStruct is a structure of nonsense
type MyStruct struct {
	// Inline the struct
	Inline struct {
		// FooBar is a even more nonsense variable
		FooBar int
	}
	// MyInt is happy to be after Inline
	MyInt int
}

This generates the following ASCIIDOC

=== MyStruct
[source, go]
----
type MyStruct struct {
	Inline	struct
	MyInt	int
}
----

MyStruct is a structure of nonsense

==== MyInt int
MyInt is happy to be after Inline

=== Inline
[source, go]
----
struct {
	FooBar	int
}
----

Inline the struct
==== FooBar int
FooBar is a even more nonsense variable