普通网友 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.

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

报告相同问题?

悬赏问题

  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示