Bytes returns a buffer containing the source code resulting from the tokens underlying the receiving file. If any updates have been made via the AST API, these will be reflected in the result.
()
| 46 | // tokens underlying the receiving file. If any updates have been made via |
| 47 | // the AST API, these will be reflected in the result. |
| 48 | func (f *File) Bytes() []byte { |
| 49 | buf := &bytes.Buffer{} |
| 50 | //nolint:errcheck // FIXME: Propogate errors upward. |
| 51 | f.WriteTo(buf) |
| 52 | return buf.Bytes() |
| 53 | } |
| 54 | |
| 55 | type comments struct { |
| 56 | leafNode |