github.com/dkischenko/gomarkdoc@v0.0.0-20230516135336-e40deae8a495/testData/docs/docs.go (about)

     1  // Package docs exercises the documentation features of golang 1.19 and above at
     2  // the package documentation level.
     3  //
     4  // # This is a heading
     5  //
     6  // This heading has a paragraph with a reference to the standard library
     7  // [math/rand] as well as a function in the file [Func], a type [Type], a type's
     8  // function [Type.Func], a non-standard library package
     9  // [golang.org/x/crypto/bcrypt.Cost], an external link [Outside Link] and
    10  // a [broken link].
    11  //
    12  // It also has a numbered list:
    13  //  1. First
    14  //  2. Second
    15  //  3. Third
    16  //
    17  // Plus one with blank lines:
    18  //
    19  //  1. First
    20  //
    21  //  2. Second
    22  //
    23  //  3. Third
    24  //
    25  // Non-numbered lists
    26  //   - First
    27  //     another line
    28  //   - Second
    29  //   - Third
    30  //
    31  // Plus blank lines:
    32  //
    33  //   - First
    34  //
    35  //     another paragraph
    36  //
    37  //   - Second
    38  //
    39  //   - Third
    40  //
    41  // And a golang code block:
    42  //
    43  //	func GolangCode(t int) int {
    44  //		return t + 1
    45  //	}
    46  //
    47  // And a random code block:
    48  //
    49  //	something
    50  //		preformatted
    51  //	in a random
    52  //			way
    53  //
    54  // There's also another file with a struct called [AnotherStruct] that has
    55  // additional methods and fields.
    56  //
    57  // We also have constants like [Constant] and [Const1] plus variables like
    58  // [Var] and and [VarB].
    59  //
    60  // [Outside Link]: https://golang.org/doc/articles/json_and_go.html
    61  package docs
    62  
    63  // Func is present in this file.
    64  func Func(param int) int {
    65  	return param
    66  }
    67  
    68  // Type is a type in this file.
    69  type Type struct{}
    70  
    71  // TypeFunc is a func within a type in this file.
    72  func (t *Type) Func() {}
    73  
    74  // Constant is a constant.
    75  const Constant = 3
    76  
    77  // Var is a var.
    78  var Var = 2
    79  
    80  // This is a constant block
    81  const (
    82  	Const1 = 1
    83  	Const2 = 2
    84  	Const3 = 3
    85  )
    86  
    87  // This is a var block
    88  var (
    89  	VarA = 'a'
    90  	VarB = 'b'
    91  	VarC = 'c'
    92  )