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