summaryrefslogtreecommitdiffhomepage
path: root/tools/pyang_plugins/bgpyang2golang.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pyang_plugins/bgpyang2golang.py')
-rw-r--r--tools/pyang_plugins/bgpyang2golang.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/pyang_plugins/bgpyang2golang.py b/tools/pyang_plugins/bgpyang2golang.py
index f3e42368..c2ebc7c9 100644
--- a/tools/pyang_plugins/bgpyang2golang.py
+++ b/tools/pyang_plugins/bgpyang2golang.py
@@ -733,15 +733,13 @@ def translate_type(key):
# 'hoge-hoge' -> 'HogeHoge'
def convert_to_golang(type_string):
a = type_string.split('.')
- a = map(lambda x: x.capitalize(), a) # XXX locale sensitive
- return '.'.join( ''.join(t.capitalize() for t in x.split('-')) for x in a)
+ a = [x.capitalize() for x in a] # XXX locale sensitive
+ return '.'.join(''.join(t.capitalize() for t in x.split('-')) for x in a)
# 'hoge-hoge' -> 'HOGE_HOGE'
def convert_const_prefix(type_string):
- a = type_string.split('-')
- a = map(lambda x: x.upper(), a) # XXX locale sensitive
- return '_'.join(a)
+ return type_string.replace('-', '_').upper()
def chop_suf(s, suf):