package main import ( "github.com/gin-gonic/gin" "pro2d/common/components" "testing" ) type HttpAction struct { } func (h *HttpAction) PrintA(c *gin.Context) (int, interface{}) { return 0, "I'm A" } func (h *HttpAction) PrintB(c *gin.Context) (int, interface{}) { return 0, "I'm B" } func TestHttpServer_Start(t *testing.T) { web := components.NewHttpServer("v1") web.BindHandler(&HttpAction{}) web.Start() }