-
-
Notifications
You must be signed in to change notification settings - Fork 26
Quickstart Go
Reasno edited this page Apr 10, 2020
·
3 revisions
package main
import (
"github.com/hyperf/gotask/v2/pkg/gotask"
"log"
)
// App sample
type App struct{}
// Hi returns greeting message.
func (a *App) Hi(name interface{}, r *interface{}) error {
*r = map[string]interface{}{
"hello": name,
}
return nil
}
func main() {
gotask.Register(new(App))
if err := gotask.Run(); err != nil {
log.Fatal(err)
}
}
Full Demo: https://github.com/Hyperf/gotask/blob/master/example/Server.go