...

Source file src/go.einride.tech/aip/fieldmask/wildcard.go

Documentation: go.einride.tech/aip/fieldmask

     1  package fieldmask
     2  
     3  import "google.golang.org/protobuf/types/known/fieldmaskpb"
     4  
     5  // WildcardPath is the path used for update masks that should perform a full replacement.
     6  const WildcardPath = "*"
     7  
     8  // IsFullReplacement reports whether a field mask contains the special wildcard path,
     9  // meaning full replacement (the equivalent of PUT).
    10  func IsFullReplacement(fm *fieldmaskpb.FieldMask) bool {
    11  	return len(fm.GetPaths()) == 1 && fm.GetPaths()[0] == WildcardPath
    12  }
    13  

View as plain text