summaryrefslogtreecommitdiffhomepage
path: root/tools/pyang_plugins
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pyang_plugins')
-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))