code: func NewDynamoDBClient(table string) (*Client, error) {
  	var c *aws.Config
  	if os.Getenv("DYNAMODB_LOCAL") != "" {
  		log.Debug("DYNAMODB_LOCAL is set")
  		endpoint := "http://localhost:8000"
  		c = &aws.Config{
  			Endpoint: &endpoint,
  		}
  	} else {
  		c = nil
  	}
  
  	session := session.New(c)
  
  	// Fail early, if no credentials can be found
  	_, err := session.Config.Credentials.Get()
  	if err != nil {
  		return nil, err
  	}
  
  	d := dynamodb.New(session)
  
  	// Check if the table exists
  	_, err = d.DescribeTable(&dynamodb.DescribeTableInput{TableName: &table})
  	if err != nil {
  		return nil, err
  	}
  	return &Client{d, table}, nil
  }
docs: // NewDynamoDBClient returns an *dynamodb.Client with a connection to the region
  // configured via the AWS_REGION environment variable.
  // It returns an error if the connection cannot be made or the table does not exist.