1package render
23import"strings"45funcHello()string{6return"Hello World!"7}89funcgreetings(name string)string{// private10return"Welcome, "+ name +"!"11}1213funcRender(path string)string{14switch{15case path =="hello":16returnHello()17case strings.HasPrefix(path,"greetings/"):18 name := strings.Split(path,"/")[1]// take string after slash19 name = strings.Title(name)// capitalize first letter20returngreetings(name)21case path =="":22 out :="- [hello](/r/moul_basics_004:hello)\n"23 out +="- [greetings/Manfred](/r/moul_basics_004:greetings/Manfred)\n"24return out
25}26return"404"27}28