micro/config/source/file/format.go

16 lines
238 B
Go
Raw Normal View History

2019-05-31 01:11:13 +03:00
package file
import (
"strings"
"github.com/micro/go-micro/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()
}