github.com/rmarku/gomarkdoc@v0.0.0-20230517164305-78688ebe4325/testData/docs/README.md (about) 1 <!-- Code generated by gomarkdoc. DO NOT EDIT --> 2 3 # docs 4 5 ```go 6 import "github.com/rmarku/gomarkdoc/testData/docs" 7 ``` 8 9 Package docs exercises the documentation features of golang 1.19 and above at the package documentation level. 10 11 ### This is a heading 12 13 This heading has a paragraph with a reference to the standard library [math/rand](https://pkg.go.dev/math/rand/) as well as a function in the file [Func](#Func), a type [Type](#Type), a type's function [Type.Func](#Type.Func), a non\-standard library package [golang.org/x/crypto/bcrypt.Cost](https://pkg.go.dev/golang.org/x/crypto/bcrypt/#Cost), an external link [Outside Link](https://golang.org/doc/articles/json_and_go.html) and a \[broken link\]. 14 15 It also has a numbered list: 16 17 1. First 18 2. Second 19 3. Third 20 21 Plus one with blank lines: 22 23 1. First 24 25 2. Second 26 27 3. Third 28 29 Non\-numbered lists 30 31 - First another line 32 - Second 33 - Third 34 35 Plus blank lines: 36 37 - First 38 39 another paragraph 40 41 - Second 42 43 - Third 44 45 And a golang code block: 46 47 ``` 48 func GolangCode(t int) int { 49 return t + 1 50 } 51 ``` 52 53 And a random code block: 54 55 ``` 56 something 57 preformatted 58 in a random 59 way 60 ``` 61 62 There's also another file with a struct called [AnotherStruct](#AnotherStruct) that has additional methods and fields. 63 64 We also have constants like [Constant](#Constant) and [Const1](#Const1) plus variables like [Var](#Var) and and [VarB](#VarA). 65 66 ## Index 67 68 - [Constants](#constants) 69 - [Variables](#variables) 70 - [func Func(param int) int](#Func) 71 - [type AnotherStruct](#AnotherStruct) 72 - [func NewAnotherStruct() \*AnotherStruct](#NewAnotherStruct) 73 - [func (s \*AnotherStruct) GetField() string](#AnotherStruct.GetField) 74 - [type Type](#Type) 75 - [func (t \*Type) Func()](#Type.Func) 76 77 ## Constants 78 79 <a name="Const1"></a>This is a constant block 80 81 ```go 82 const ( 83 Const1 = 1 84 Const2 = 2 85 Const3 = 3 86 ) 87 ``` 88 89 <a name="Constant"></a>Constant is a constant. 90 91 ```go 92 const Constant = 3 93 ``` 94 95 ## Variables 96 97 <a name="VarA"></a>This is a var block 98 99 ```go 100 var ( 101 VarA = 'a' 102 VarB = 'b' 103 VarC = 'c' 104 ) 105 ``` 106 107 <a name="Var"></a>Var is a var. 108 109 ```go 110 var Var = 2 111 ``` 112 113 <a name="Func"></a> 114 115 ## func [Func](https://github.com/rmarku/gomarkdoc/blob/master/testData/docs/docs.go#L64) 116 117 ```go 118 func Func(param int) int 119 ``` 120 121 Func is present in this file. 122 123 <a name="AnotherStruct"></a> 124 125 ## type [AnotherStruct](https://github.com/rmarku/gomarkdoc/blob/master/testData/docs/anotherFile.go#L5-L7) 126 127 AnotherStruct has methods like [\*AnotherStruct.GetField](#AnotherStruct.GetField) and also has an initializer called [NewAnotherStruct](#NewAnotherStruct). 128 129 ```go 130 type AnotherStruct struct { 131 Field string 132 } 133 ``` 134 135 <a name="NewAnotherStruct"></a> 136 137 ### func [NewAnotherStruct](https://github.com/rmarku/gomarkdoc/blob/master/testData/docs/anotherFile.go#L10) 138 139 ```go 140 func NewAnotherStruct() *AnotherStruct 141 ``` 142 143 NewAnotherStruct\(\) makes [\*AnotherStruct](#AnotherStruct). 144 145 <a name="AnotherStruct.GetField"></a> 146 147 ### func \(\*AnotherStruct\) [GetField](https://github.com/rmarku/gomarkdoc/blob/master/testData/docs/anotherFile.go#L17) 148 149 ```go 150 func (s *AnotherStruct) GetField() string 151 ``` 152 153 GetField gets \[\*AnotherStruct.Field\]. 154 155 <a name="Type"></a> 156 157 ## type [Type](https://github.com/rmarku/gomarkdoc/blob/master/testData/docs/docs.go#L69) 158 159 Type is a type in this file. 160 161 ```go 162 type Type struct{} 163 ``` 164 165 <a name="Type.Func"></a> 166 167 ### func \(\*Type\) [Func](https://github.com/rmarku/gomarkdoc/blob/master/testData/docs/docs.go#L72) 168 169 ```go 170 func (t *Type) Func() 171 ``` 172 173 TypeFunc is a func within a type in this file. 174 175 Generated by [gomarkdoc](https://github.com/rmarku/gomarkdoc)