Skip to content

Commit

Permalink
minor template issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasjarosch committed Jun 29, 2019
1 parent 1d2a012 commit d5952f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions templates/cmd_main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/oklog/oklog/pkg/group"
"github.com/prometheus/client_golang/prometheus/promhttp"
googleGrpc "google.golang.org/grpc"
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus"

pb "{{ .Protobuf.Package }}"
svcGrpc "{{ .Service.Module }}/internal/grpc"
Expand Down Expand Up @@ -50,12 +50,12 @@ func main() {

// serve gRPC server
grpcServer := googleGrpc.NewServer(
googleGrpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),
googleGrpc.UnaryInterceptor(grpcPrometheus.UnaryServerInterceptor),
)
g.Add(initGrpc(grpcServer, grpcHandler, logger), func(error) {
grpcServer.GracefulStop()
})
grpc_prometheus.Register(grpcServer)
grpcPrometheus.Register(grpcServer)

// serve debug http server (prometheus)
http.DefaultServeMux.Handle("/metrics", promhttp.Handler())
Expand Down
8 changes: 4 additions & 4 deletions templates/implementation.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"context"

"github.com/lukasjarosch/godin/pkg/log"
"{{ .Service.Module }}/internal/service"
_ "{{ .Service.Module }}/internal/service"
)

type serviceImplementation struct {
Expand All @@ -18,8 +18,8 @@ func NewServiceImplementation(logger log.Logger) *serviceImplementation {
}
}

{{ range .Service.Methods }}
{{ template "service_method" . }}
{{ end }}
{{- range .Service.Methods }}
{{- template "service_method" . }}
{{- end }}


2 changes: 1 addition & 1 deletion templates/request_response.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package endpoint

import (
"{{ .Service.Module }}/internal/service"
_ "{{ .Service.Module }}/internal/service"
)

type (
Expand Down

0 comments on commit d5952f5

Please sign in to comment.