Using Go packages

To use a public package in your Go application add the line to the top of your program to import the package

import "github.com/aws/aws-sdk-go/service/s3"

If this is the first time you are using the package, the error message appears in the output window of Atom when you save the file

cannot find package “github.com/aws/aws-sdk-go/service/s3” in any of:

C:\Go\src\github.com\aws\aws-sdk-go\service\s3 (from $GOROOT) C:\Users\MY_USERNAME\go\src\github.com\aws\aws-sdk-go\service\s3 (from $GOPATH)

Open a terminal window and execute the command to download the package

go get github.com/aws/aws-sdk-go/service/s3

 

Leave a comment

Your email address will not be published. Required fields are marked *