# README
function
import "github.com/cloudogu/gomarkdoc/testData/lang/function"
Index
Constants
Set of constants for this package.
const (
ConstA = "string"
ConstB = true
)
Variables
Variable is a package-level variable.
var Variable = 5
func Standalone
func Standalone(p1 int, p2 string) (int, error)
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/cloudogu/gomarkdoc/testData/lang/function"
)
func main() {
res, _ := function.Standalone(2, "abc")
fmt.Println(res)
}
Output
2
Example (Zero)
package main
import (
"fmt"
"github.com/cloudogu/gomarkdoc/testData/lang/function"
)
func main() {
res, _ := function.Standalone(0, "def")
fmt.Println(res)
}
Output
0
type Generic
Generic is a struct with a generic type.
type Generic[T any] struct{}
func (Generic[T]) WithGenericReceiver
func (r Generic[T]) WithGenericReceiver()
WithGenericReceiver has a receiver with a generic type.
Example
package main
import (
"github.com/cloudogu/gomarkdoc/testData/lang/function"
)
func main() {
r := function.Generic[int]{}
r.WithGenericReceiver()
}
type Receiver
Receiver is a type used to demonstrate functions with receivers.
type Receiver struct{}
Example
package main
import (
"fmt"
"github.com/cloudogu/gomarkdoc/testData/lang/function"
)
func main() {
r := &function.Receiver{}
fmt.Println(r)
}
Example (Sub Test)
package main
import (
"github.com/cloudogu/gomarkdoc/testData/lang/function"
)
func main() {
var r function.Receiver
r.WithReceiver()
}
func New
func New() Receiver
New is an initializer for Receiver.
func (*Receiver) WithPtrReceiver
func (r *Receiver) WithPtrReceiver()
WithPtrReceiver has a pointer receiver.
func (Receiver) WithReceiver
func (r Receiver) WithReceiver()
WithReceiver has a receiver.
Generated by gomarkdoc
# Functions
New is an initializer for Receiver.
Standalone provides a function that is not part of a type.
# Variables
Variable is a package-level variable.