MCPcopy Create free account
hub / github.com/devfeel/dotweb / TestBind

Function TestBind

example/bind/main.go:47–61  ·  view source on GitHub ↗
(ctx dotweb.Context)

Source from the content-addressed store, hash-verified

45}
46
47func TestBind(ctx dotweb.Context) error {
48 type UserInfo struct {
49 UserName string
50 Sex int
51 }
52 user := new(UserInfo)
53 errstr := "no error"
54 if err := ctx.Bind(user); err != nil {
55 errstr = err.Error()
56 } else {
57
58 }
59
60 return ctx.WriteString("TestBind [" + errstr + "] " + fmt.Sprint(user))
61}
62
63func GetBind(ctx dotweb.Context) error {
64 //type UserInfo struct {

Callers

nothing calls this directly

Calls 3

BindMethod · 0.65
ErrorMethod · 0.65
WriteStringMethod · 0.65

Tested by

no test coverage detected