mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
f23638c036
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
16 lines
241 B
Go
16 lines
241 B
Go
package file
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/micro/go-micro/v2/config/encoder"
|
|
)
|
|
|
|
func format(p string, e encoder.Encoder) string {
|
|
parts := strings.Split(p, ".")
|
|
if len(parts) > 1 {
|
|
return parts[len(parts)-1]
|
|
}
|
|
return e.String()
|
|
}
|