1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-18 08:26:38 +02:00
go-micro/config/source/file/format.go

16 lines
228 B
Go
Raw Normal View History

2019-05-31 00:11:13 +02:00
package file
import (
"strings"
2021-10-12 13:55:53 +02:00
"go-micro.dev/v4/config/encoder"
2019-05-31 00:11:13 +02: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()
}