github.com/anthonyme00/gomarkdoc@v1.0.0/testData/lang/function/func_test.go (about)

     1  package function_test
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/anthonyme00/gomarkdoc/testData/lang/function"
     7  )
     8  
     9  func ExampleStandalone() {
    10  	// Comment
    11  	res, _ := function.Standalone(2, "abc")
    12  	fmt.Println(res)
    13  	// Output: 2
    14  }
    15  
    16  func ExampleStandalone_zero() {
    17  	res, _ := function.Standalone(0, "def")
    18  	fmt.Println(res)
    19  	// Output: 0
    20  }
    21  
    22  func ExampleReceiver() {
    23  	// Add some comments
    24  	r := &function.Receiver{}
    25  	// And some more
    26  	fmt.Println(r)
    27  }
    28  
    29  func ExampleReceiver_subTest() {
    30  	var r function.Receiver
    31  	r.WithReceiver()
    32  }
    33  
    34  func ExampleGeneric_WithGenericReceiver() {
    35  	r := function.Generic[int]{}
    36  	r.WithGenericReceiver()
    37  }