Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/segmentio/encoding
/ Size
Function
Size
proto/proto.go:10–14 ·
view source on GitHub ↗
(v any)
Source
from the content-addressed store, hash-verified
8
)
9
10
func
Size(v any) int {
11
t, p := inspect(v)
12
c := cachedCodecOf(t)
13
return
c.size(p, inline|toplevel)
14
}
15
16
func
Marshal(v any) ([]byte, error) {
17
t, p := inspect(v)
Callers
4
BenchmarkEncodeMessage
Function · 0.85
BenchmarkEncodeMap
Function · 0.85
BenchmarkEncodeSlice
Function · 0.85
TestMarshalUnmarshal
Function · 0.85
Calls
2
inspect
Function · 0.85
cachedCodecOf
Function · 0.85
Tested by
4
BenchmarkEncodeMessage
Function · 0.68
BenchmarkEncodeMap
Function · 0.68
BenchmarkEncodeSlice
Function · 0.68
TestMarshalUnmarshal
Function · 0.68
Used in the wild
real call sites across dependent graphs
searching dependent graphs…