mirror of
https://github.com/go-kratos/kratos.git
synced 2026-05-22 10:15:24 +02:00
style: add gosimple linter and gofmt linter (#1242)
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
func main() {
|
||||
router := echo.New()
|
||||
router.GET("/home", func(ctx echo.Context) error {
|
||||
return ctx.JSON(200,"Hello echo")
|
||||
return ctx.JSON(200, "Hello echo")
|
||||
})
|
||||
|
||||
httpSrv := http.NewServer(http.Address(":8000"))
|
||||
@@ -25,4 +25,4 @@ func main() {
|
||||
if err := app.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,4 @@ func I18N() middleware.Middleware {
|
||||
|
||||
func FromContext(ctx context.Context) *i18n.Localizer {
|
||||
return ctx.Value(localizerKey{}).(*i18n.Localizer)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ func (s *GreeterService) SayHello(ctx context.Context, in *v1.HelloRequest) (*v1
|
||||
helloMsg, err := localizer.Localize(&i18n.LocalizeConfig{
|
||||
DefaultMessage: &i18n.Message{
|
||||
Description: "sayhello",
|
||||
ID: "sayHello",
|
||||
One: "Hello {{.Name}}",
|
||||
Other: "Hello {{.Name}}",
|
||||
ID: "sayHello",
|
||||
One: "Hello {{.Name}}",
|
||||
Other: "Hello {{.Name}}",
|
||||
},
|
||||
TemplateData: map[string]interface{}{
|
||||
"Name": in.Name,
|
||||
|
||||
@@ -56,4 +56,4 @@ func callHTTP(r *registry.Registry) {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Printf("[http] SayHello %+v\n", reply)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user