MCPcopy Index your code
hub / github.com/gavv/httpexpect / Decode

Method Decode

string.go:73–83  ·  view source on GitHub ↗

Decode unmarshals the underlying value attached to the String to a target variable. target should be one of these: - pointer to an empty interface - pointer to a string Example: value := NewString(t, "foo") var target string value.Decode(&target) assert.Equal(t, "foo", target)

(target interface{})

Source from the content-addressed store, hash-verified

71//
72// assert.Equal(t, "foo", target)
73func (s *String) Decode(target interface{}) *String {
74 opChain := s.chain.enter("Decode()")
75 defer opChain.leave()
76
77 if opChain.failed() {
78 return s
79 }
80
81 canonDecode(opChain, s.value, target)
82 return s
83}
84
85// Alias is similar to Value.Alias.
86func (s *String) Alias(name string) *String {

Callers 1

TestString_DecodeFunction · 0.95

Calls 4

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

Tested by 1

TestString_DecodeFunction · 0.76