summaryrefslogtreecommitdiffhomepage
path: root/tools/pyang_plugins/bgpyang2golang.py
diff options
context:
space:
mode:
authorWataru Ishida <ishida.wataru@lab.ntt.co.jp>2016-11-11 11:08:28 +0000
committerWataru Ishida <ishida.wataru@lab.ntt.co.jp>2016-11-14 02:15:44 +0000
commit480eb327831d56a795ea28d2c7293ab134d78a47 (patch)
tree234f6fd40fab0be9c8035e4c23fc2f60391a5a64 /tools/pyang_plugins/bgpyang2golang.py
parent926ab34220431de2561c17269d473f8fc8f33217 (diff)
config: add json tag for config structures
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'tools/pyang_plugins/bgpyang2golang.py')
-rw-r--r--tools/pyang_plugins/bgpyang2golang.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/pyang_plugins/bgpyang2golang.py b/tools/pyang_plugins/bgpyang2golang.py
index 5be6569f..f6ea1a86 100644
--- a/tools/pyang_plugins/bgpyang2golang.py
+++ b/tools/pyang_plugins/bgpyang2golang.py
@@ -274,7 +274,7 @@ def emit_class_def(ctx, yang_statement, struct_name, prefix):
tag_name = 'state'
val_name_go = 'State'
- print >> o, ' {0}\t{1} `mapstructure:"{2}"`'.format(val_name_go, emit_type_name, tag_name)
+ print >> o, ' {0}\t{1} `mapstructure:"{2}" json:"{2},omitempty"`'.format(val_name_go, emit_type_name, tag_name)
equal_elems.append((val_name_go, emit_type_name, equal_type, equal_data))