package excel import ( "reflect" "strings" ) type TagAttr struct { Name string Style string Auth string } func (t *TagAttr) initTag(data map[string]string) { v := reflect.ValueOf(t).Elem() for name, value := range data { field := v.FieldByName(strings.Title(name)) if !field.IsValid() { continue } field.Set(reflect.ValueOf(value)) } }