Code Monkey home page Code Monkey logo

Comments (3)

wenovus avatar wenovus commented on July 3, 2024

Hi @hellt, the code for creating the name is at https://github.com/openconfig/ygot/blob/master/gogen/goelements.go#L239

To change it you can add a new generation option and flag that would exclude the module name in the generated name.

I believe the reason it was originally included is because multiple modules can conflict. But if there is no reason to expect a conflict of top-level nodes in your YANG modules, then this would make sense. This was the decision for "compressed" generated code, so you can borrow the logic used there:

ygot/util/yang.go

Lines 178 to 180 in 4dcc65e

case IsRoot(e):
// This is a top-level module within the goyang structure, so is not output
return false

from ygot.

robshakir avatar robshakir commented on July 3, 2024

Wen is right here -- in goyang we build a tree per-module by creating a top-level entity named after the module's name -- the issue otherwise is that if you have ietf-interfaces and openconfig-interfaces on the same build then they would conflict.

from ygot.

hellt avatar hellt commented on July 3, 2024

Thank you,
I will have a look at adding a generator option to cater for smaller YANG code bases where non interfering top level containers are the norm.

In the meantime I will close the issue, as the questions has been answered.

from ygot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.