ygot icon indicating copy to clipboard operation
ygot copied to clipboard

Generate Name() method for all GoStructs

Open wenovus opened this issue 3 years ago • 2 comments

This would be akin to the Node.NName() function in goyang.

This is useful when GetNode/SetNode functions are called and the schema needs to be retrieved via oc.SchemaTree["<name of GoStruct>"]

Thanks to @dan-lepage for the feedback.

wenovus avatar Jul 29 '21 18:07 wenovus

Will this ever differ from Reflect.TypeOf(struct).Name()? If not, this could also be a single ygot function, e.g. ygot.TypeName(g GoStruct).

dan-lepage avatar Jul 29 '21 18:07 dan-lepage

Thanks Dan, that's what I'll do.

I'd like to add this after the util packages are split. This will go to the gostruct package.

wenovus avatar Oct 13 '21 23:10 wenovus