MCPcopy Create free account
hub / github.com/gavv/httpexpect / Decode

Method Decode

number.go:69–79  ·  view source on GitHub ↗

Decode unmarshals the underlying value attached to the Number to a target variable. target should be one of these: - pointer to an empty interface - pointer to any integer or floating type Example: value := NewNumber(t, 123) var target interface{} valude.decode(&target) assert.Equal(t, 123,

(target interface{})

Source from the content-addressed store, hash-verified

67//
68// assert.Equal(t, 123, target)
69func (n *Number) Decode(target interface{}) *Number {
70 opChain := n.chain.enter("Decode()")
71 defer opChain.leave()
72
73 if opChain.failed() {
74 return n
75 }
76
77 canonDecode(opChain, n.value, target)
78 return n
79}
80
81// Alias is similar to Value.Alias.
82func (n *Number) Alias(name string) *Number {

Callers 1

TestNumber_DecodeFunction · 0.95

Calls 4

canonDecodeFunction · 0.85
enterMethod · 0.80
leaveMethod · 0.80
failedMethod · 0.80

Tested by 1

TestNumber_DecodeFunction · 0.76