GoLand:如何将AWS SDK GO V1的导入建议替换为V2?

huangapple go评论82阅读模式
英文:

GoLand: How to replace AWS SDK GO V1 import suggestions with V2

问题

我正在使用GoLand(适用于golang的JetBrains IDE)访问AWS服务,并使用相应的SDK。每次我第一次使用服务客户端时,我想使用GoLand的“自动导入”功能导入SDK。IDE然后会提供导入.../aws-sdk-go/...(请参见下面的图片)。但是,现在已经有了AWS SDK GO的新版本,即.../aws-sdk-go-v2/...。目前,我让GoLand导入V1,然后通过更新相应的行到V2来更改go.mod文件。

有没有办法告诉GoLand只建议导入V2而不是V1?

英文:

I am working with GoLand (JetBrains IDE for golang) accessing the AWS services with the corresponding SDK. Every time I'm using a service client for the first time I want to use the "auto-import" feature of GoLand to import the SDK. The IDE then offers to import .../aws-sdk-go/... (see image below). But there is already a new version of the AWS SDK GO, namely .../aws-sdk-go-v2/.... Right now I let GoLand import V1 and change the go.mod file afterwards by updating the corresponding line to V2.

Is there a way to tell GoLand to only suggest imports for V2 instead of V1?

GoLand:如何将AWS SDK GO V1的导入建议替换为V2?

Thank for your help!

答案1

得分: 1

你可以在“设置/首选项 | Go | 导入 | 从导入和完成中排除”中添加你想要省略的导入。

英文:

You can add imports you want to omit from completion/imports from Settings/Preferences | Go | Imports | Exclude from import and completion.

huangapple
  • 本文由 发表于 2021年7月30日 23:10:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/68593286.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定