#!/usr/bin/env python import os print('compile proto to go file') for cur, dirs, files in os.walk('.'): if cur[2:8] == 'google': continue for file in files: f, ext = os.path.splitext(file) if ext != '.proto': continue os.system('protoc --go_out=. {}'.format(os.path.join(cur,file))) print('.') print('done. check if there any errors')