def get_doc(cmd_wd, cmd_arg):
# `go doc` (Go 1.5+) has different capabilities to `godoc`.
cmd = [
'go',
'doc',
'-c',
]
if cmd_arg:
# Most of the interesting identifiers in the pseudo-package builtin are
# considered unexported because they start with lowercase.
if cmd_arg == 'builtin' or cmd_arg.startswith('builtin.'):
cmd.append('-u')
cmd.append(cmd_arg)
try:
cmd_output = run_tool(cmd, wd=cmd_wd)
except:
sublime.status_message('FAILED: ' + ' '.join(cmd))
return
return cmd_output.decode('utf-8')
评论列表
文章目录