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: env.go
    path of file: ./repos/kubernetes/vendor/go.opentelemetry.io/otel/sdk/resource
    
    the code of the file until where you have to start completion: // Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (
    
func constructOTResources(s string) (*Resource, error) {
	if s == "" {
		return Empty(), nil
	}
	pairs := strings.Split(s, ",")
	var attrs []attribute.KeyValue
	var invalid []string
	for _, p := range pairs {
		k, v, found := strings.Cut(p, "=")
		if !found {
			invalid = append(invalid, p)
			continue
		}
		key := strings.TrimSpace(k)
		val, err := url.QueryUnescape(strings.TrimSpace(v))
		if err != nil {
			// Retain original value if decoding fails, otherwise it will be
			// an empty string.
			val = v
			otel.Handle(err)
		}
		attrs = append(attrs, attribute.String(key, val))
	}
	var err error
	if len(invalid) > 0 {
		err = fmt.Errorf("%w: %v", errMissingValue, invalid)
	}
	return NewSchemaless(attrs...), err
}