2019-05-30 23:11:13 +01:00
|
|
|
package file
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
2020-08-19 17:47:17 +03:00
|
|
|
"github.com/unistack-org/micro/v3/config/encoder"
|
2019-05-30 23:11:13 +01: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()
|
|
|
|
}
|