duanfen7676 2014-04-08 05:36
浏览 217

如何使PyCharm与Go插件配合使用?

I am using PyCharm 3.1.1 and I have installed the Go plugin for IntelliJ Idea. I did export GOROOT=$(go env GOROOT) to prevent PyCharm from complaining about missing GOROOT environment variable.

Now I was able to create a sample project, but the run command complains:

Error running untitled1.go: No Go Sdk defined for this project

On other sites I found that I should do something like:

Go to the File -> Project Structure and configure Go SDK by clicking + button and selecting /usr/lib/go/ folder.

But I don't have File -> Project Structure menu item.

How to make PyCharm work with the Go plugin?

  • 写回答

5条回答 默认 最新

  • duanran8648 2014-05-08 00:21
    关注

    If you're running on OS X, you'll have to use the launchctl setenv command to set the GOROOT environment variable, so it's available system wide, which includes launching applications via the GUI

    launchctl setenv GOROOT $(go env GOROOT)
    

    To check it's set

    launchctl getenv GOROOT
    

    For the values to persist across reboots, you'll need to edit (or create) /etc/launchd.conf:

    setenv GOROOT [path]
    

    See this answer for more information of the format of this file. Note that you won't be able to call $(go env GOROOT) within launchd.conf

    评论

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题