I just started to do some "serious" code in GoLang and I'm trying to use a custom utils library I built with some common features in a new project. One of my common library methods returns an instance of the AWS SDK Session struct that I'm trying to use on my outer project.
I'm using dep for my project dependencies and I'm importing in both (the project and the library) the SDK the same way:
import "github.com/aws/aws-sdk-go/aws/session"
However the compiler complains that the Session struct I'm returning in my library method is different from the Session interface I need in my project.
sess, err := myawsutils.NewSession()
s3Client := s3.New(sess)
*session.Session does not implement "gitlab.com/xyz/storage-sls.xyz.com/api/go/vendor/github.com/aws/aws-sdk-go/aws/client".ConfigProvider (wrong type for ClientConfig method)
have ClientConfig(string, ...*"gitlab.com/xyz/golang-sls-utils/vendor/github.com/aws/aws-sdk-go/aws".Config) "gitlab.com/xyz/golang-sls-utils/vendor/github.com/aws/aws-sdk-go/aws/client".Config
want ClientConfig(string, ...*"gitlab.com/xyz/storage-sls.xyz.com/api/go/vendor/github.com/aws/aws-sdk-go/aws".Config) "gitlab.com/xyz/storage-sls.xyz.com/api/go/vendor/github.com/aws/aws-sdk-go/aws/client".Config
Ideally I would like to share references to the same structures along multiple projects. I'm definitely missing some basic core concept of the way the language works and compiles. Appreciate any help. Thanks!!