github.com/fraugster/parquet-go@v0.12.0/floor/fieldname.go (about)

     1  package floor
     2  
     3  import (
     4  	"reflect"
     5  	"strings"
     6  )
     7  
     8  var fieldNameFunc = fieldNameToLower
     9  
    10  func fieldNameToLower(field reflect.StructField) string {
    11  	parquetStructTag, ok := field.Tag.Lookup("parquet")
    12  	if !ok {
    13  		return strings.ToLower(field.Name)
    14  	}
    15  
    16  	parquetStructTagFields := strings.Split(parquetStructTag, ",")
    17  
    18  	return strings.TrimSpace(parquetStructTagFields[0])
    19  }