普通网友 2017-09-15 13:49
浏览 155
已采纳

在Gogland中,我使用go run获取了“提供的标志,但未定义:-goversion”

I am trying to run my go script called release.go in the Goglang built in terminal and it gives me the following output

$ go run release.go
# command-line-arguments
flag provided but not defined: -goversion
usage: compile [options] file.go...
  -%    debug non-static initializers
...

If I run this in my terminal outside of Gogland the release.go file runs without issue.

This problem started occurring after upgrading from version 1.8.3 to 1.9 and I have never used the -goversion flag before.

Current Gogland version:

Gogland (1.0 Preview) 1.0 EAP
Build #GO-172.3968.45, built on September 5, 2017
Gogland EAP User
Expiration date: December 4, 2017
JRE: 1.8.0_152-release-915-b11 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6

How can I fix this problem so that I can run go from the built in terminal in Gogland?

  • 写回答

1条回答 默认 最新

  • duanpo7282 2017-09-15 13:53
    关注

    You've installed one Go version from one distribution and another Go version from another distribution (likely one from Homebrew and another from the distribution binaries, for example).

    Either remove one or the other as your system is currently in an undefined state.

    Gogland has nothing to do with this as it does not inject any parameters when you are using the terminal. You can run the file from Gogland itself by clicking on the green arrow next to func main() and it will use the internal logic to determine the execution model based on the SDK selected and the other parameters provided. You can customize the build process via Run | Edit Configurations.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站