|
- package util
-
- import "strings"
-
- // ID defines a point id.
- type ID string
-
- func (i ID) Panel() string {
- split := strings.Split(string(i), ".")
- if len(split) < 2 {
- return ""
- }
-
- return split[0]
- }
-
- func (i ID) Name() string {
- split := strings.Split(string(i), ".")
- if len(split) < 2 {
- return split[0]
- }
-
- return split[1]
- }
-
- func (i ID) Deref() ID {
- return ID(i.Name())
- }
|