structinfo.go
func JSONFieldsFromStruct(v reflect.Value) []string {
	if v.Kind() != reflect.Struct {
		return nil
	}

	m := getType2jfm(v.Type())
	m.lock.Lock()
	defer m.lock.Unlock()

	l := make([]string, 0, len(m.fields))
	for k := range m.fields {
		l = append(l, k)
	}
	return l
}
func JSONFieldsFromStruct(v reflect.Value) []string {
	if v.Kind() != reflect.Struct {
		return nil
	}

	m := getType2jfm(v.Type())
	m.lock.Lock()
	defer m.lock.Unlock()

	l := make([]string, 0, len(m.fields))
	for k := range m.fields {
		l = append(l, k)
	}
	return l
}
func JSONFieldsFromStruct ( v reflect . Value ) [ ] string { if v . Kind ( ) != reflect . Struct { return nil } m := getType2jfm ( v . Type ( ) ) m . lock . Lock ( ) defer m . lock . Unlock ( ) l := make ( [ ] string , 0 , len ( m . fields ) ) for k := range m . fields { l = append ( l , k ) } return l }
// JSONFieldsFromStruct returns the names of JSON fields associated
// with the given struct. Returns nil if v is not a struct
JSONFieldsFromStruct returns the names of JSON fields associated with the given struct . Returns nil if v is not a struct