func ExampleFilter_update_request() {
	profile := &testproto.Profile{
		User: &testproto.User{
			UserId: 64,
			Name:   "user name",
		},
		Photo: &testproto.Photo{
			PhotoId: 2,
			Path:    "photo path",
			Dimensions: &testproto.Dimensions{
				Width:  100,
				Height: 120,
			},
		},
		LoginTimestamps: []int64{1, 2, 3},
	}
	updateProfileRequest := &testproto.UpdateProfileRequest{
		Profile: &testproto.Profile{
			User: &testproto.User{
				UserId: 65,  
				Name:   "new user name",
			},
			Photo: &testproto.Photo{
				PhotoId: 3,  
				Path:    "new photo path",
				Dimensions: &testproto.Dimensions{
					Width: 50,
				},
			},
			LoginTimestamps: []int64{4, 5}},
		Fieldmask: &field_mask.FieldMask{
			Paths: []string{"user.name", "photo.path", "photo.dimensions.width", "login_timestamps"}},
	}
	updateProfileRequest.Fieldmask.Normalize()
	if !updateProfileRequest.Fieldmask.IsValid(profile) {
		panic("invalid field mask")
	}
	fmutils.Filter(updateProfileRequest.GetProfile(), updateProfileRequest.Fieldmask.GetPaths())
	proto.Merge(profile, updateProfileRequest.GetProfile())
	fmt.Println(reSpaces.ReplaceAllString(profile.String(), " "))
}
ExampleFilter_update_request illustrates an API endpoint that updates an existing entity.
The request to that endpoint provides a field mask that should be used to update the entity.
package fmutils_test
import (
	"fmt"
	"regexp"
	"google.golang.org/genproto/protobuf/field_mask"
	"google.golang.org/protobuf/proto"
	"github.com/mennanov/fmutils"
	"github.com/mennanov/fmutils/testproto"
)
var reSpaces = regexp.MustCompile(`\s+`)