github.com/johnnyeven/libtools@v0.0.0-20191126065708-61829c1adf46/codegen/loaderx/fixtures/comments.go (about)

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