I\'m writing a program in which one of the components must be able to take a path it is given (such as /help/index.html, or /help/) and a relative path
/help/index.html
/help/
The path.Join when used with path.Dir should do what you want. See http://golang.org/pkg/path/#example_Join for an interactive example.
path.Join
path.Dir
path.Join(path.Dir("/help/help1.html"), "../content.txt")
This will return /content.txt.
/content.txt