github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/depends/x/pkgx/__tests__/comments.go (about)

     1  // package
     2  package main
     3  
     4  import (
     5  	"fmt"
     6  	"time"
     7  )
     8  
     9  // type Date
    10  type Date time.Time
    11  
    12  const (
    13  	// a
    14  	A = "A" // A
    15  	// b
    16  	B = "B" // B
    17  	// c
    18  	C = "C" // C
    19  )
    20  
    21  // type Test
    22  type Test struct {
    23  	// field String
    24  	String string
    25  	// field Int
    26  	Int int
    27  	// field Bool
    28  	Bool bool
    29  	// field Date
    30  	Date Date
    31  }
    32  
    33  // method
    34  func (Test) Recv() {
    35  
    36  }
    37  
    38  // type Test2
    39  type (
    40  	Test2 struct {
    41  		// field String
    42  		String string
    43  		// field Int
    44  		Int int
    45  		// field Bool
    46  		Bool bool
    47  	}
    48  )
    49  
    50  // var
    51  var test = Test{
    52  	String: "",
    53  	Int:    1 + 1,
    54  	Bool:   true,
    55  }
    56  
    57  // var
    58  var (
    59  	// test2
    60  	test2 = Test{
    61  		String: "",
    62  		Int:    1,
    63  		Bool:   true,
    64  	}
    65  	// test3
    66  	test3 = Test{
    67  		String: "",
    68  		Int:    1,
    69  		Bool:   true,
    70  	}
    71  )
    72  
    73  // func Print
    74  //
    75  //go:generate echo
    76  func Print(a string, b string) string {
    77  	return a + b
    78  }
    79  
    80  // func fn
    81  func fn() {
    82  	// Call
    83  	res := Print("", "")
    84  	if res != "" {
    85  		// print
    86  		fmt.Println(res)
    87  	}
    88  }