MCPcopy
hub / github.com/golang/protobuf / isScalarKind

Function isScalarKind

proto/extensions.go:326–333  ·  view source on GitHub ↗

isScalarKind reports whether k is a protobuf scalar kind (except bytes). This function exists for historical reasons since the representation of scalars differs between v1 and v2, where v1 uses *T and v2 uses T.

(k reflect.Kind)

Source from the content-addressed store, hash-verified

324// This function exists for historical reasons since the representation of
325// scalars differs between v1 and v2, where v1 uses *T and v2 uses T.
326func isScalarKind(k reflect.Kind) bool {
327 switch k {
328 case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String:
329 return true
330 default:
331 return false
332 }
333}
334
335// clearUnknown removes unknown fields from m where remover.Has reports true.
336func clearUnknown(m protoreflect.Message, remover interface {

Callers 2

GetExtensionFunction · 0.85
SetExtensionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected