import "github.com/princjef/gomarkdoc/testData/docs"
Package docs exercises the documentation features of golang 1.19 and above at the package documentation level.
This heading has a paragraph with a reference to the standard library math/rand as well as a function in the file Func, a type Type, a type's function Type.Func, a non-standard library package golang.org/x/crypto/bcrypt.Cost, an external link Outside Link and a [broken link].
It also has a numbered list:
- First
- Second
- Third
Plus one with blank lines:
-
First
-
Second
-
Third
Non-numbered lists
- First another line
- Second
- Third
Plus blank lines:
-
First
another paragraph
-
Second
-
Third
And a golang code block:
func GolangCode(t int) int {
return t + 1
}
And a random code block:
something
preformatted
in a random
way
There's also another file with a struct called AnotherStruct that has additional methods and fields.
We also have constants like Constant and Const1 plus variables like Var and and VarB.
const (
Const1 = 1
Const2 = 2
Const3 = 3
)
const Constant = 3
var (
VarA = 'a'
VarB = 'b'
VarC = 'c'
)
var Var = 2
func Func
func Func(param int) int
Func is present in this file.
type AnotherStruct
AnotherStruct has methods like \*AnotherStruct.GetField and also has an initializer called NewAnotherStruct.
type AnotherStruct struct {
Field string
}
func NewAnotherStruct
func NewAnotherStruct() *AnotherStruct
NewAnotherStruct() makes \*AnotherStruct.
func (*AnotherStruct) GetField
func (s *AnotherStruct) GetField() string
GetField gets [*AnotherStruct.Field].
type Type
Type is a type in this file.
type Type struct{}
func (*Type) Func
func (t *Type) Func()
TypeFunc is a func within a type in this file.
Generated by gomarkdoc