in http via http.FileSystem.
I'm already implement needed functions, but stuck when i need somethins like:
/first/second/third/
in this case i need to get element with name fist, return it value and
recursive go to the last object.
Does it possible?
I have ugly code that not works as needed:
for _, name := range strings.Split(f.name, "/") {
val := reflect.ValueOf(data)
for i := 0; i < val.NumField(); i++ {
valueField := val.Field(i)
typeField := val.Type().Field(i)
tag := typeField.Tag
if tag.Get("json") == name &&
!strings.HasSuffix(f.name, name) {
data = valueField.Interface()
continue nameLoop
}
if strings.HasSuffix(f.name, "/") {
buffer = append(buffer,
[]byte(fmt.Sprintf("%s\n", tag.Get("json")))...)
} else {
buffer = append(buffer,
[]byte(fmt.Sprintf("%v\n", valueField.Interface()))...)
}
}
}
does somebody knows how to do that i need ?+0 or already have needed code?
--
Vasiliy Tolstov,
e-mail: [email protected]
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.