Solution Review: Writing to a WIKI Page
Explore how to define a struct with fields, write its data to a file, and read the file contents back into a struct in Go. This lesson covers using methods with struct pointers for saving and loading data, as well as basic error handling in file operations.
We'll cover the following...
We'll cover the following...
In the code above, we define a struct of type Page struct at line 7 with two fields: Title and Body.
Now, look at the header of the load method at line 17. It takes title, the filename as a parameter (apart from the ...