Updating Functions to Improve the Markdown Preview Tool
Explore how to improve a Go Markdown preview tool by updating the run function to accept alternative templates and handle errors. Learn to modify main and test functions to incorporate new features, ensuring your application remains flexible and well-tested.
Updating the run() function
Let’s update the definition of the run() function so it accepts another string input
parameter called tFname that will represent the name of an alternate template
file:
Since the parseContent() function now also returns an error, we update the run()
function to handle this condition when calling parseContent(), like this:
The run() function
...