github.com/mstephano/gqlgen-schemagen@v0.0.0-20230113041936-dd2cd4ea46aa/internal/rewrite/testdata/example.go (about)

     1  package testdata
     2  
     3  import (
     4  	"fmt"
     5  
     6  	lol "bytes"
     7  )
     8  
     9  type Foo struct {
    10  	Field int
    11  }
    12  
    13  func (m *Foo) Method(arg int) {
    14  	// leading comment
    15  
    16  	// field comment
    17  	m.Field++
    18  
    19  	// trailing comment
    20  }
    21  
    22  func (m *Foo) String() string {
    23  	var buf lol.Buffer
    24  	buf.WriteString(fmt.Sprintf("%d", m.Field))
    25  	return buf.String()
    26  }