github.com/anthonyme00/gomarkdoc@v1.0.0/testData/lang/function/README-azure-devops.md (about)

     1  <!-- Code generated by gomarkdoc. DO NOT EDIT -->
     2  
     3  # function
     4  
     5  ```go
     6  import "github.com/anthonyme00/gomarkdoc/testData/lang/function"
     7  ```
     8  
     9  ## Index
    10  
    11  - [Constants](<#constants>)
    12  - [Variables](<#variables>)
    13  - [func Standalone\(p1 int, p2 string\) \(int, error\)](<#Standalone>)
    14  - [type Generic](<#Generic>)
    15    - [func \(r Generic\[T\]\) WithGenericReceiver\(\)](<#Generic[T].WithGenericReceiver>)
    16  - [type Receiver](<#Receiver>)
    17    - [func New\(\) Receiver](<#New>)
    18    - [func \(r \*Receiver\) WithPtrReceiver\(\)](<#Receiver.WithPtrReceiver>)
    19    - [func \(r Receiver\) WithReceiver\(\)](<#Receiver.WithReceiver>)
    20  
    21  
    22  ## Constants
    23  
    24  <a name="ConstA"></a>Set of constants for this package.
    25  
    26  ```go
    27  const (
    28      ConstA = "string"
    29      ConstB = true
    30  )
    31  ```
    32  
    33  ## Variables
    34  
    35  <a name="Variable"></a>Variable is a package\-level variable.
    36  
    37  ```go
    38  var Variable = 5
    39  ```
    40  
    41  <a name="Standalone"></a>
    42  ## func [Standalone](<https://github.com/princjef/gomarkdoc?path=testData%2Flang%2Ffunction%2Ffunc.go&version=GBmaster&lineStyle=plain&line=14&lineEnd=14&lineStartColumn=1&lineEndColumn=48>)
    43  
    44  ```go
    45  func Standalone(p1 int, p2 string) (int, error)
    46  ```
    47  
    48  Standalone provides a function that is not part of a type.
    49  
    50  Additional description can be provided in subsequent paragraphs, including code blocks and headers
    51  
    52  ### Header A
    53  
    54  This section contains a code block.
    55  
    56  ```
    57  Code Block
    58  More of Code Block
    59  ```
    60  
    61  <details><summary>Example</summary>
    62  <p>
    63  
    64  
    65  
    66  ```go
    67  package main
    68  
    69  import (
    70  	"fmt"
    71  
    72  	"github.com/anthonyme00/gomarkdoc/testData/lang/function"
    73  )
    74  
    75  func main() {
    76  	// Comment
    77  	res, _ := function.Standalone(2, "abc")
    78  	fmt.Println(res)
    79  }
    80  ```
    81  
    82  #### Output
    83  
    84  ```
    85  2
    86  ```
    87  
    88  </p>
    89  </details>
    90  
    91  <details><summary>Example (Zero)</summary>
    92  <p>
    93  
    94  
    95  
    96  ```go
    97  package main
    98  
    99  import (
   100  	"fmt"
   101  
   102  	"github.com/anthonyme00/gomarkdoc/testData/lang/function"
   103  )
   104  
   105  func main() {
   106  	res, _ := function.Standalone(0, "def")
   107  	fmt.Println(res)
   108  }
   109  ```
   110  
   111  #### Output
   112  
   113  ```
   114  0
   115  ```
   116  
   117  </p>
   118  </details>
   119  
   120  <a name="Generic"></a>
   121  ## type [Generic](<https://github.com/princjef/gomarkdoc?path=testData%2Flang%2Ffunction%2Ffunc.go&version=GBmaster&lineStyle=plain&line=33&lineEnd=33&lineStartColumn=1&lineEndColumn=29>)
   122  
   123  Generic is a struct with a generic type.
   124  
   125  ```go
   126  type Generic[T any] struct{}
   127  ```
   128  
   129  <a name="Generic[T].WithGenericReceiver"></a>
   130  ### func \(Generic\[T\]\) [WithGenericReceiver](<https://github.com/princjef/gomarkdoc?path=testData%2Flang%2Ffunction%2Ffunc.go&version=GBmaster&lineStyle=plain&line=36&lineEnd=36&lineStartColumn=1&lineEndColumn=42>)
   131  
   132  ```go
   133  func (r Generic[T]) WithGenericReceiver()
   134  ```
   135  
   136  WithGenericReceiver has a receiver with a generic type.
   137  
   138  <details><summary>Example</summary>
   139  <p>
   140  
   141  
   142  
   143  ```go
   144  package main
   145  
   146  import (
   147  	"github.com/anthonyme00/gomarkdoc/testData/lang/function"
   148  )
   149  
   150  func main() {
   151  	r := function.Generic[int]{}
   152  	r.WithGenericReceiver()
   153  }
   154  ```
   155  
   156  </p>
   157  </details>
   158  
   159  <a name="Receiver"></a>
   160  ## type [Receiver](<https://github.com/princjef/gomarkdoc?path=testData%2Flang%2Ffunction%2Ffunc.go&version=GBmaster&lineStyle=plain&line=19&lineEnd=19&lineStartColumn=1&lineEndColumn=23>)
   161  
   162  Receiver is a type used to demonstrate functions with receivers.
   163  
   164  ```go
   165  type Receiver struct{}
   166  ```
   167  
   168  <details><summary>Example</summary>
   169  <p>
   170  
   171  
   172  
   173  ```go
   174  package main
   175  
   176  import (
   177  	"fmt"
   178  
   179  	"github.com/anthonyme00/gomarkdoc/testData/lang/function"
   180  )
   181  
   182  func main() {
   183  	// Add some comments
   184  	r := &function.Receiver{}
   185  	// And some more
   186  	fmt.Println(r)
   187  }
   188  ```
   189  
   190  </p>
   191  </details>
   192  
   193  <details><summary>Example (Sub Test)</summary>
   194  <p>
   195  
   196  
   197  
   198  ```go
   199  package main
   200  
   201  import (
   202  	"github.com/anthonyme00/gomarkdoc/testData/lang/function"
   203  )
   204  
   205  func main() {
   206  	var r function.Receiver
   207  	r.WithReceiver()
   208  }
   209  ```
   210  
   211  </p>
   212  </details>
   213  
   214  <a name="New"></a>
   215  ### func [New](<https://github.com/princjef/gomarkdoc?path=testData%2Flang%2Ffunction%2Ffunc.go&version=GBmaster&lineStyle=plain&line=22&lineEnd=22&lineStartColumn=1&lineEndColumn=20>)
   216  
   217  ```go
   218  func New() Receiver
   219  ```
   220  
   221  New is an initializer for Receiver.
   222  
   223  <a name="Receiver.WithPtrReceiver"></a>
   224  ### func \(\*Receiver\) [WithPtrReceiver](<https://github.com/princjef/gomarkdoc?path=testData%2Flang%2Ffunction%2Ffunc.go&version=GBmaster&lineStyle=plain&line=30&lineEnd=30&lineStartColumn=1&lineEndColumn=37>)
   225  
   226  ```go
   227  func (r *Receiver) WithPtrReceiver()
   228  ```
   229  
   230  WithPtrReceiver has a pointer receiver.
   231  
   232  <a name="Receiver.WithReceiver"></a>
   233  ### func \(Receiver\) [WithReceiver](<https://github.com/princjef/gomarkdoc?path=testData%2Flang%2Ffunction%2Ffunc.go&version=GBmaster&lineStyle=plain&line=27&lineEnd=27&lineStartColumn=1&lineEndColumn=33>)
   234  
   235  ```go
   236  func (r Receiver) WithReceiver()
   237  ```
   238  
   239  WithReceiver has a receiver.
   240  
   241  Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)