12345678910111213141516171819202122 |
- package topic
- import (
- "fmt"
- "strings"
- )
- const (
- TOPPrefix = "go-top"
- )
- func TOP(path string) string {
- return joinPath(TOPPrefix, path)
- }
- func joinPath(prefix string, path string) string {
- if strings.TrimSpace(path) == "" {
- return prefix
- }
- path = strings.TrimLeft(strings.TrimLeft(strings.TrimSpace(path), "/"), "\\")
- return fmt.Sprintf("%s.%s", prefix, path)
- }
|