Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const ( ConstA = "string" ConstB = true )
Set of constants for this package.
Variables ¶
View Source
var Variable = 5
Variable is a package-level variable.
Functions ¶
func Standalone ¶
Standalone provides a function that is not part of a type.
Additional description can be provided in subsequent paragraphs, including code blocks and headers
Header A ¶
This section contains a code block.
Code Block More of Code Block
Example ¶
package main import ( "fmt" "github.com/chengyumeng/gomarkdoc/testData/lang/function" ) func main() { res, _ := function.Standalone(2, "abc") fmt.Println(res) }
Output: 2
Example (Zero) ¶
package main import ( "fmt" "github.com/chengyumeng/gomarkdoc/testData/lang/function" ) func main() { res, _ := function.Standalone(0, "def") fmt.Println(res) }
Output: 0
Types ¶
type Generic ¶
type Generic[T any] struct{}
Generic is a struct with a generic type.
func (Generic[T]) WithGenericReceiver ¶
func (r Generic[T]) WithGenericReceiver()
WithGenericReceiver has a receiver with a generic type.
Example ¶
package main import ( "github.com/chengyumeng/gomarkdoc/testData/lang/function" ) func main() { r := function.Generic[int]{} r.WithGenericReceiver() }
Output:
type Receiver ¶
type Receiver struct{}
Receiver is a type used to demonstrate functions with receivers.
Example ¶
package main import ( "fmt" "github.com/chengyumeng/gomarkdoc/testData/lang/function" ) func main() { r := &function.Receiver{} fmt.Println(r) }
Output:
Example (SubTest) ¶
package main import ( "github.com/chengyumeng/gomarkdoc/testData/lang/function" ) func main() { var r function.Receiver r.WithReceiver() }
Output:
func (*Receiver) WithPtrReceiver ¶
func (r *Receiver) WithPtrReceiver()
WithPtrReceiver has a pointer receiver.
Click to show internal directories.
Click to hide internal directories.