我在golang中有以下功能:
cannot use sess (type *session.Session) as type "github.com/aws/aws-sdk-go/aws/client".ConfigProvider in argument to iam.New:
*session.Session does not implement "github.com/aws/aws-sdk-go/aws/client".ConfigProvider (wrong type for ClientConfig method)
have ClientConfig(string, ...*"stash/cloud/sphinx/vendor/github.com/aws/aws-sdk-go/aws".Config) "stash/cloud/sphinx/vendor/github.com/aws/aws-sdk-go/aws/client".Config
want ClientConfig(string, ...*"github.com/aws/aws-sdk-go/aws".Config) "github.com/aws/aws-sdk-go/aws/client".Config
现在,我运行时遇到以下错误:
var Categories = {
Education: {
name: 'Education',
models: ['Engineering', 'Arts', 'B.com'],
},
Medical: {
name: 'Medical',
models: ['Radiologist', 'Surgeon', 'Neurologist'],
},
Agriculture: {
name: 'Agriculture',
models: [ ' Domesticated', 'Bee keep', 'Live stock ', 'Orchards ',
'Organic farming '],
},
};
我必须更改导入的方法,但我该怎么做呢?
谢谢!
答案 0 :(得分:0)
此处的问题是您的github.com/aws/aws-sdk-go/aws/session
软件包已售卖,它是从文件夹stash/cloud/sphinx/vendor/github.com/aws/aws-sdk-go/aws
加载的。
但是你要传递它的功能:iam.New()
不是出售的,它不是来自同一个供应商文件夹(stash/cloud/sphinx/vendor/xxx
),而是直接来自github.com/aws/aws-sdk-go/service/iam
。
将两个软件包放在同一个供应商文件夹下,或者不放置。你的一个依赖工具可能会这样做(例如glide
),在这种情况下你应该指示你的工具同时处理这两个工具。