MCPcopy Index your code
hub / github.com/dearcode/candy / DecodeUserInfo

Function DecodeUserInfo

client/util.go:56–62  ·  view source on GitHub ↗

DecodeUserInfo 把json数据解析成UserInfo

(data []byte)

Source from the content-addressed store, hash-verified

54
55// DecodeUserInfo 把json数据解析成UserInfo
56func DecodeUserInfo(data []byte) (*UserInfo, error) {
57 userInfo := &UserInfo{}
58 if err := json.Unmarshal(data, &userInfo); err != nil {
59 return nil, fmt.Errorf("Decode UserInfo error:%v", err.Error())
60 }
61 return userInfo, nil
62}
63
64// DecodeUserList 把json数据解析成UserList
65func DecodeUserList(data []byte) (*UserList, error) {

Callers 1

TestUpdateUserInfoFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by 1

TestUpdateUserInfoFunction · 0.68