Skip to content

Commit

Permalink
Merge pull request #296 from tdakkota/fix/tempalte-annotations
Browse files Browse the repository at this point in the history
fix(gen): update template annotations due to refactor
  • Loading branch information
ernado authored Apr 15, 2022
2 parents 5bc1fb4 + 4e683bd commit a7d267f
Show file tree
Hide file tree
Showing 27 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion gen/_template/faker/faker_alias.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "faker/faker_alias" }}
// SetFake set fake values.
func (s *{{ $.Name }}) SetFake() {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/faker/faker_enum.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "faker/faker_enum" }}
// SetFake set fake values.
func (s *{{ $.Name }}) SetFake() {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/faker/faker_generic.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "faker/faker_generic" }}
// SetFake set fake values.
func (s *{{ $.Name }}) SetFake() {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/faker/faker_map.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "faker/faker_map" }}
// SetFake set fake values.
func (s *{{ $.Name }}) SetFake() {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/faker/faker_struct.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "faker/faker_struct" }}
// SetFake set fake values.
func (s *{{ $.Name }}) SetFake() {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/faker/faker_sum.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "faker/faker_sum" }}{{ $d := $.JSON.Sum -}}
// SetFake set fake values.
func (s *{{ $.Name }}) SetFake() {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/faker/fakers.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "faker/fakers" }}

{{- if $.IsStruct }}
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/json/encoders.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "json/encoders" }}

{{- if $.IsStruct }}
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/json/encoders_alias.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "json/encoders_alias" }}
// Encode encodes {{ $.Name }} as json.
func (s {{ $.Name }}) Encode(e *jx.Encoder) {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/json/encoders_enum.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "json/encoders_enum" }}
// Encode encodes {{ $.Name }} as json.
func (s {{ $.Name }}) Encode(e *jx.Encoder) {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/json/encoders_generic.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "json/encoders_generic" }}
{{ $g := $.GenericOf }}
{{ $v := $.GenericVariant }}
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/json/encoders_map.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "json/encoders_map" }}
{{- $va := $.Validators }}
// Encode implements json.Marshaler.
Expand Down
4 changes: 2 additions & 2 deletions gen/_template/json/encoders_struct.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- define "json/encode_struct_fields" }}
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.JSONFields*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.JSONFields*/ -}}
{{- range $i, $f := $ }}
{
{{- $elem := field_elem $f }}
Expand All @@ -9,7 +9,7 @@
{{- end }}

{{- define "json/encoders_struct" }}
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- $fields := $.JSON.Fields }}
{{- $additional := $.JSON.AdditionalProps }}
{{- $pattern := $.JSON.PatternProps }}
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/json/encoders_sum.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "json/encoders_sum" }}{{ $d := $.JSON.Sum -}}
// Encode encodes {{ $.Name }} as json.
func (s {{ $.Name }}) Encode(e *jx.Encoder) {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/json/stdmarshaler.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- define "json/stdmarshaler" }}
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- $g := $.GenericOf -}}
// MarshalJSON implements stdjson.Marshaler.
func (s {{ $.Name }}) MarshalJSON() ([]byte, error) {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/res_dec.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "dec_res_json" }}
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
buf := getBuf()
defer putBuf(buf)
if _, err := io.Copy(buf, resp.Body); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/res_enc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func encodeErrorResponse(response {{ $.ErrorType.Go }}, w http.ResponseWriter, s
{{ end }}

{{ define "respond" }}
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.ResponseInfo*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.ResponseInfo*/ -}}
{{- if not $.NoContent }}{{- /* Set content-type */}}
w.Header().Set("Content-Type", {{ quote $.ContentType }})
{{- end }}{{- /* Set content-type */}}
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/router.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (s *Server) FindRoute(method, path string) (r Route, _ bool) {
{{ end }}

{{ define "route_handle_request" }}
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Operation*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Operation*/ -}}
s.handle{{ $.Name }}Request([{{ $.PathParamsCount }}]string{
{{- range $i, $_ := times $.PathParamsCount }}
args[{{ $i }}],
Expand Down
4 changes: 2 additions & 2 deletions gen/_template/schema/alias.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "schema/alias" }}
type {{ $.Name }} {{ $.AliasTo.Go }}
{{ end }}
{{ end }}
4 changes: 2 additions & 2 deletions gen/_template/schema/enum.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "schema/enum" }}
type {{ $.Name }} {{ $.Primitive }}

Expand All @@ -8,4 +8,4 @@ const (
{{- end }}
)

{{ end }}
{{ end }}
4 changes: 2 additions & 2 deletions gen/_template/schema/generic.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "schema/generic" }}

{{- $g := $.GenericOf }}
Expand Down Expand Up @@ -79,4 +79,4 @@ func (o {{ $.Name }}) Or(d {{ $g.Go }}) {{ $g.Go }} {
return d
}

{{ end }}
{{ end }}
2 changes: 1 addition & 1 deletion gen/_template/schema/map.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "schema/map" }}
type {{ $.Name }} map[string]{{ $.Item.Go }}

Expand Down
2 changes: 1 addition & 1 deletion gen/_template/schema/schema.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "schema/schema" }}

{{- if $.Doc -}}
Expand Down
4 changes: 2 additions & 2 deletions gen/_template/schema/stream.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "schema/stream" }}
type {{ $.Name }} struct {
Data io.Reader
Expand All @@ -8,4 +8,4 @@ func (s {{ $.Name }}) Read(p []byte) (n int, err error) {
return s.Data.Read(p)
}

{{ end }}
{{ end }}
2 changes: 1 addition & 1 deletion gen/_template/schema/struct.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "schema/struct" }}
{{- if eq (len $.Fields) 0 }}{{/* Blank struct */}}
type {{ $.Name }} struct{}
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/schema/sum.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "schema/sum" }}
// {{ $.Name }} represents sum type.
type {{ $.Name }} struct {
Expand Down
2 changes: 1 addition & 1 deletion gen/_template/uri/encoders.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /*gotype: github.com/ogen-go/ogen/internal/ir.Type*/ -}}
{{- /*gotype: github.com/ogen-go/ogen/gen/ir.Type*/ -}}
{{- define "uri/encoders" }}

func (v {{ $.Go }}) encodeURI(e uri.Encoder) error {
Expand Down

0 comments on commit a7d267f

Please sign in to comment.