code: func joinDropLast(lines []string) string {
  	l := len(lines)
  	lns := lines
  	if l > 0 && len(strings.TrimSpace(lines[l-1])) == 0 {
  		lns = lines[:l-1]
  	}
  	return strings.Join(lns, "\n")
  }
docs: // Many thanks go to https://github.com/yvasiyarov/swagger
  // this is loosely based on that implementation but for swagger 2.0