| 1 | struct Path {} |
| 2 | |
| 3 | struct Doc { |
| 4 | mut: |
| 5 | content string |
| 6 | path Path |
| 7 | } |
| 8 | |
| 9 | fn get_file(path string, create bool) !Path { |
| 10 | return Path{} |
| 11 | } |
| 12 | |
| 13 | fn main() { |
| 14 | mut doc := Doc{ |
| 15 | content: 'this is a first line.' |
| 16 | path: get_file('config.md', true) |
| 17 | } |
| 18 | println('First println\n' + doc.content + '\n') |
| 19 | doc.content += '\nthis is a second line.' |
| 20 | println('Second println\n' + doc.content) |
| 21 | } |
| 22 |