Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

29 lignes
379B

  1. package util
  2. import "strings"
  3. // ID defines a point id.
  4. type ID string
  5. func (i ID) Panel() string {
  6. split := strings.Split(string(i), ".")
  7. if len(split) < 2 {
  8. return ""
  9. }
  10. return split[0]
  11. }
  12. func (i ID) Name() string {
  13. split := strings.Split(string(i), ".")
  14. if len(split) < 2 {
  15. return split[0]
  16. }
  17. return split[1]
  18. }
  19. func (i ID) Deref() ID {
  20. return ID(i.Name())
  21. }