func (e *EnvProvider) Retrieve() (Value, error) {
	e.retrieved = false
	id := os.Getenv("AWS_ACCESS_KEY_ID")
	if id == "" {
		id = os.Getenv("AWS_ACCESS_KEY")
	}
	secret := os.Getenv("AWS_SECRET_ACCESS_KEY")
	if secret == "" {
		secret = os.Getenv("AWS_SECRET_KEY")
	}
	if id == "" {
		return Value{}, ErrAccessKeyIDNotFound
	}
	if secret == "" {
		return Value{}, ErrSecretAccessKeyNotFound
	}
	e.retrieved = true
	return Value{
		AccessKeyID:     id,
		SecretAccessKey: secret,
		SessionToken:    os.Getenv("AWS_SESSION_TOKEN"),
	}, nil
}
Retrieve retrieves the keys from the environment.
package credentials
import (
	"os"
	"github.com/ks3sdklib/aws-sdk-go/internal/apierr"
)
var (
	ErrAccessKeyIDNotFound = apierr.New("EnvAccessKeyNotFound", "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment", nil)
	ErrSecretAccessKeyNotFound = apierr.New("EnvSecretNotFound", "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment", nil)
)
type EnvProvider struct {
	retrieved bool
}
func NewEnvCredentials() *Credentials {
	return NewCredentials(&EnvProvider{})
}