github.com/maeglindeveloper/gqlgen@v0.13.1-0.20210413081235-57808b12a0a0/internal/rewrite/testdata/example.go (about) 1 package testdata 2 3 import "fmt" 4 5 import lol "bytes" 6 7 type Foo struct { 8 Field int 9 } 10 11 func (m *Foo) Method(arg int) { 12 // leading comment 13 14 // field comment 15 m.Field++ 16 17 // trailing comment 18 } 19 20 func (m *Foo) String() string { 21 var buf lol.Buffer 22 buf.WriteString(fmt.Sprintf("%d", m.Field)) 23 return buf.String() 24 }