You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: lambda.go
    path of file: ./repos/up/platform/lambda
    
    the code of the file until where you have to start completion: // Package lambda implements the API Gateway & AWS Lambda platform.
package lambda

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"strings"
	"sync"
	"time"

	"github.com/apex/lo
    
func (p *Platform) isPending(c *lambda.Lambda) error {
	var attempt int
	maxAttempts := 30       // TODO: ideally max attempts is configurable
	wait := time.Second * 5 // TODO: ideally some backoff

retry:
	attempt++

	log.Debugf("checking if function is pending (attempt %d of %d)", attempt, maxAttempts)
	conf, err := c.GetFunctionConfiguration(&lambda.GetFunctionConfigurationInput{
		FunctionName: &p.config.Name,
	})
	if err != nil {
		return errors.Wrapf(err, "getting function config")
	}

	if *conf.State == "Active" && *conf.LastUpdateStatus != "InProgress" {
		log.Debugf("function is in state %q / %q", *conf.State, *conf.LastUpdateStatus)
		return nil
	}

	if attempt >= maxAttempts {
		log.Debugf("max attempts exceeded")
		return errors.Errorf("function is stuck in the state %q / %q", *conf.State, *conf.LastUpdateStatus)
	}

	log.Debugf("function is in state %q / %q, trying again in %s", *conf.State, *conf.LastUpdateStatus, wait)
	time.Sleep(wait)
	goto retry
}