notes-server/server/path.go

23 lines
299 B
Go

package server
import (
"fmt"
"path"
)
type Path struct {
dir string
base string
}
func (p Path) String() string {
return path.Join(p.dir, p.base)
}
func (p Path) LI() string {
content := fmt.Sprintf("<li><a href=%q>", p.String())
content += p.base
content += "</li>"
return content
}