github.com/annwntech/go-micro/v2@v2.9.5/config/source/file/format.go (about)

     1  package file
     2  
     3  import (
     4  	"strings"
     5  
     6  	"github.com/annwntech/go-micro/v2/config/encoder"
     7  )
     8  
     9  func format(p string, e encoder.Encoder) string {
    10  	parts := strings.Split(p, ".")
    11  	if len(parts) > 1 {
    12  		return parts[len(parts)-1]
    13  	}
    14  	return e.String()
    15  }