pkger/here/path.go

21 lines
233 B
Go
Raw Normal View History

2019-10-09 20:21:54 +03:00
package here
2019-09-01 00:00:24 +03:00
import (
"fmt"
)
type Path struct {
2019-11-12 02:17:26 +03:00
Pkg string
Name string
2019-09-01 00:00:24 +03:00
}
func (p Path) String() string {
if p.Name == "" {
p.Name = "/"
}
2019-10-22 16:54:50 +03:00
if p.Pkg == "" {
return p.Name
2019-09-01 00:00:24 +03:00
}
2019-10-22 16:54:50 +03:00
return fmt.Sprintf("%s:%s", p.Pkg, p.Name)
2019-09-01 00:00:24 +03:00
}