英文:
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?
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
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论