dpli36193 2016-03-24 02:25
浏览 89
已采纳

SublimeLinter的GoType问题

I'm a bit new to Go, and I've been trying to use the SublimeLinter-contrib-gotype package to lint my files. It works well for the most part, but for some reason it throws an error if I try to import a Go package from GitHub. I've been trying to use the simple example from the Echo framework. When I run the code, it works fine but for some reason the linter is causing issues.

It throws an error saying:

could not import github.com/labstack/echo (can't find import: )

I've already run the go get github.com/labstack/echo command, but it doesn't seem to have helped.

I've attached a screenshot as well:

And here is a link to the code I was using.

  • 写回答

1条回答 默认 最新

  • dongshuo8756 2016-03-24 07:07
    关注

    I'd faced the same problem. Try running

    launchctl setenv GOPATH $GOPATH

    and restarting ST, this won't work after a reboot.

    Source

    If you use Go Sublime, the following should work better.

    Sublime Text menu > Preferences > Package Settings > GoSublime > Settings - Default / User

    "shell": ["/usr/bin/bash"],
    "env": {"GOPATH": "/Users/username/gopath/"},
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭