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: scrape.pb.gw.go
    path of file: ./repos/parca/gen/proto/go/parca/scrape/v1alpha1
    
    the code of the file until where you have to start completion: // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: parca/scrape/v1alpha1/scrape.proto

/*
Package scrapev1alpha1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.
*/
p
    
func RegisterScrapeServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
	conn, err := grpc.DialContext(ctx, endpoint, opts...)
	if err != nil {
		return err
	}
	defer func() {
		if err != nil {
			if cerr := conn.Close(); cerr != nil {
				grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
			}
			return
		}
		go func() {
			<-ctx.Done()
			if cerr := conn.Close(); cerr != nil {
				grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
			}
		}()
	}()

	return RegisterScrapeServiceHandler(ctx, mux, conn)
}