Goguru는 Go Guru 도구를 통합하는 Sublimetext 3의 Golang 플러그인입니다.
https://github.com/alvarolm/goguru/issues에서 문제 나 개선 사항을보고하십시오
Waigani의 이전 작업을 기반으로합니다.
Guru Tool은 여전히 개발 중입니다. 계획, 공식 GIT 리포 및 코드 검토를 확인하려면 다음을 확인하려면 다음을 확인하십시오.
기호 (함수, 가변, 상수 등)를 선택하거나 선택하고 ctrl+shift+g 누릅니다. 선택할 수있는 다음 분석 모드가 제공됩니다.
callees show possible targets of selected function call
callers show possible callers of selected function
callstack show path from callgraph root to selected function
definition show declaration of selected identifier
describe describe selected syntax: definition, methods, etc
freevars show free variables of selection
implements show 'implements' relation for selected type or method
peers show send/receive corresponding to selected channel op
pointsto show variables the selected pointer may point to
referrers show all refs to entity denoted by selected identifier
what show basic information about the selected syntax node
whicherrs show possible values of the selected error variable
모드 중 하나를 선택하면 출력이 새 탭에 표시됩니다. 결과의 파일 이름을 두 번 클릭하여 직접 점프하십시오.
ctrl 키를 누른 상태에서 정의로 오른쪽으로 점프하기 위해 기호를 right-click 수도 있습니다.
http://wbond.net/sublime_packages/package_control에서 숭고한 패키지 컨트롤을 설치하십시오. 설치를 완료하려면 ST를 다시 시작하십시오.
명령 팔레트 (기본 Ctrl+Shift+P 또는 CMD+Shift+P)를 가져오고 패키지 제어를 입력하십시오. 패키지를 설치 한 다음 리턴을 누르거나 해당 옵션을 클릭하여 활성화하십시오. 사용 가능한 패키지 목록이 포함 된 새로운 빠른 패널이 제공됩니다. Goguru를 입력하고 Return을 입력하거나 Goguru를 설치하기 위해 입력하십시오. Goguru에 대한 항목이 없으면 이미 이미 설치했을 것입니다.
Goguru에는 작동하기 위해 몇 가지 변수가 설정되어 있습니다. 기본 설정 Preferences > Package Settings > GoGuru > Settings-Default 의 주석에 설명되어 있습니다.
{
// use golangconfig, if false then shellenv will be used to get golang environment variables
"goguru_use_golangconfig" : false ,
// adds to the guru_scope the current package of the the working file
"goguru_use_current_package" : true ,
// besides showing the result, jump directly to the definition
"goguru_jumpto_definition" : false ,
// The output can either be one of: 'buffer', 'output_panel'
// Buffers can hold results from more than one invocation
// Output panels sit underneath the editor area and are easily dismissed
"goguru_output" : "output_panel" ,
// print debug info to the terminal
"goguru_debug" : false ,
// Set guru's output to json
"goguru_json" : false ,
// an array of scopes of analysis for guru.
// e.g (for github.com/juju/juju) "guru_scope": ["github.com/juju/juju/cmd/juju", "github.com/juju/juju/cmd/jujud"]
"goguru_scope" : [ ] ,
// an array of build tags of analyzed source files
"goguru_tags" : [ ] ,
// env overwrites the default shell environment vars
// e.g "env": { "GOPATH": "$HOME/go/bin:$PATH" }
// not used when goguru_use_golangconfig is set to true
"goguru_env" : { } ,
} Preferences > Package Settings > GoGuru > Settings-User 에서 자신의 변수를 설정합니다.
프로젝트 특정 설정을 만들 수도 있습니다. 먼저 현재 작업 공간을 프로젝트 Project > Save as project ... 다음 프로젝트 Project > Edit Project 편집하십시오. 아래는 github.com/juju/juju codebase에서 사용할 고구루를 설정하는 예입니다.
{
"folders" :
[
{
"follow_symlinks" : true ,
"path" : "/home/user/go/src/github.com/juju/juju"
}
] ,
"settings" :
{
"GoGuru" : {
"goguru_scope" : [ "github.com/juju/juju/cmd/juju" , "github.com/juju/juju/cmd/jujud" ] ,
"goguru_output" : "output_panel"
}
} ,
}기본 키 바인딩 :
[
{ "keys" : [ "ctrl+shift+g" ] , "command" : "go_guru" } ,
{ "keys" : [ "ctrl+alt+shift+g" ] , "command" : "go_guru_show_results" } ,
{ "keys" : [ "ctrl+.+ctrl+g" ] , "command" : "go_guru_goto_definition" , "context" : [ { "key" : "selector" , "operator" : "equal" , "operand" : "source.go" } ] } ,
] 위의 Preferences > Keybindings - User 및 CTRL+Shift+G를 선호하는 키로 교체하여 자신의 키 바인딩을 설정할 수 있습니다.
"모드"arg를 추가하여 특정 모드에 대한 키 바인딩을 설정할 수도 있습니다.
...
{ "keys" : [ "ctrl+super+c" ] , "command" : "go_guru" , "args" : { "mode" : "callers" } } ,
{ "keys" : [ "ctrl+super+i" ] , "command" : "go_guru" , "args" : { "mode" : "implements" } } ,
{ "keys" : [ "ctrl+super+r" ] , "command" : "go_guru" , "args" : { "mode" : "referrers" } } ,
{ "keys" : [ "ctrl+.+ctrl+g" ] , "command" : "go_guru" , "args" : { "mode" : "definition" , output = false } } ,
...기본 마우스 바인딩 :
[
{
"button" : "button2" ,
"modifiers" : [ "ctrl" ] ,
"press_command" : "drag_select" ,
"command" : "go_guru" ,
"args" : {
"mode" : "definition" ,
"output" : false
} ,
} ,
] Goguru는 Guru 도구에 의존합니다. Goguru가 작동하려면 설치해야합니다. 명령 줄에서 다음을 실행하십시오.
go install golang.org/x/tools/cmd/guru@latest
go get -u golang.org/x/tools/cmd/guru
Goguru는 MIT 라이센스에 따라 릴리스됩니다. License.md를 참조하십시오
Goguru는 Goguru 작가 , 즉 Me (Alvarolm)의 저작권이있는 작품이며 모든 기고자입니다. Goguru의 역사에 전념하는 한 변경 사항을 제출하면 문서 나 코드가 필요합니다. 나는 당신을 기고자라고 생각합니다. 모든 Goguru 저자/기고자 목록은 저자.md를 참조하십시오.