format.go 245 B

123456789101112131415
  1. package file
  2. import (
  3. "strings"
  4. "gogs.baozhida.cn/zoie/OAuth-core/config/encoder"
  5. )
  6. func format(p string, e encoder.Encoder) string {
  7. parts := strings.Split(p, ".")
  8. if len(parts) > 1 {
  9. return parts[len(parts)-1]
  10. }
  11. return e.String()
  12. }