pkger/here/path.go

21 lines
260 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 {
Pkg string `json:"pkg"`
Name string `json:"name"`
}
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
}