func (p *baseStsProvider) CheckCache() *Credentials {
	creds := new(Credentials)
	if p.Cache != nil {
		if creds = p.Cache.Load(); creds.Value().HasKeys() {
			p.Logger.Debugf("loaded sts credentials from cache")
		} else {
			creds.Expiration = time.Unix(0, 0)
		}
	}
	return creds
}
CheckCache will load credentials from cache.  If a cache is not configured, this method will
return an empty and expired set of credentials.
package credentials
import (
	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/service/sts"
	"github.com/mmmorris1975/aws-runas/credentials/helpers"
	"github.com/mmmorris1975/aws-runas/shared"
	"os"
	"time"
)
type baseStsProvider struct {
	Client        stsApi
	Cache         CredentialCacher
	Duration      time.Duration
	ExpiryWindow  time.Duration
	Logger        shared.Logger
	SerialNumber  string
	TokenCode     string
	TokenProvider func() (string, error)
}
func newBaseStsProvider(cfg aws.Config) *baseStsProvider {
	return &baseStsProvider{
		Client:        sts.NewFromConfig(cfg),
		Logger:        new(shared.DefaultLogger),
		TokenProvider: helpers.NewMfaTokenProvider(os.Stdin).ReadInput,
	}
}