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: security_functions.go
    path of file: ./repos/goa/codegen/service/testdata
    
    the code of the file until where you have to start completion: package testdata

var EndpointInitWithoutRequirementCode = `// NewEndpoints wraps the methods of the "EndpointWithoutRequirement" service
// with endpoints.
func NewEndpoints(s Service) *Endpoints {
	return &Endpoints{
		Unsecure: NewUnsec
    
func NewSecureWithOptionalRequiredScopesEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint {
	return func(ctx context.Context, req any) (any, error) {
		p := req.(*SecureWithOptionalRequiredScopesPayload)
		var err error
		sc := security.BasicScheme{
			Name:           "basic",
			Scopes:         []string{"api:read", "api:write", "api:admin"},
			RequiredScopes: []string{"api:read", "api:write"},
		}
		var user string
		if p.User != nil {
			user = *p.User
		}
		var pass string
		if p.Pass != nil {
			pass = *p.Pass
		}
		ctx, err = authBasicFn(ctx, user, pass, &sc)
		if err != nil {
			return nil, err
		}
		return nil, s.SecureWithOptionalRequiredScopes(ctx, p)
	}
}