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

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