2019-05-31 01:11:13 +03:00
|
|
|
package file
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
2020-01-30 14:39:00 +03:00
|
|
|
"github.com/micro/go-micro/v2/config/encoder"
|
2019-05-31 01:11:13 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func format(p string, e encoder.Encoder) string {
|
|
|
|
parts := strings.Split(p, ".")
|
|
|
|
if len(parts) > 1 {
|
|
|
|
return parts[len(parts)-1]
|
|
|
|
}
|
|
|
|
return e.String()
|
|
|
|
}
|