MCPcopy
hub / github.com/golang/tools / Value

Method Value

internal/pkgbits/encoder.go:344–352  ·  view source on GitHub ↗

Value encodes and writes a constant.Value into the element bitstream.

(val constant.Value)

Source from the content-addressed store, hash-verified

342// Value encodes and writes a constant.Value into the element
343// bitstream.
344func (w *Encoder) Value(val constant.Value) {
345 w.Sync(SyncValue)
346 if w.Bool(val.Kind() == constant.Complex) {
347 w.scalar(constant.Real(val))
348 w.scalar(constant.Imag(val))
349 } else {
350 w.scalar(val)
351 }
352}
353
354func (w *Encoder) scalar(val constant.Value) {
355 switch v := constant.Val(val).(type) {

Callers

nothing calls this directly

Calls 4

SyncMethod · 0.95
BoolMethod · 0.95
scalarMethod · 0.95
KindMethod · 0.65

Tested by

no test coverage detected