Chapter 16 - HTML Templates
Exercise 2: An HTML Template
Complete the code in grocery.go
and list.html
below.
When a browser visits http://localhost:8080/fruit
, your app should respond with this HTML (the spacing doesn’t have to match exactly):
<html>
<ul>
<li>apples</li>
<li>oranges</li>
<li>pears</li>
</ul>
</html>
And when a browser visits http://localhost:8080/meat
, your app should respond with this HTML:
<html>
<ul>
<li>chicken</li>
<li>beef</li>
<li>lamb</li>
</ul>
</html>
Solution
grocery.go
list.html