Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

*: fix external enums generation #10

Merged
merged 1 commit into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions templates/go/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

{{ range $pkg, $path := enumPackages (externalEnums .) }}
{{ $pkg }} "{{ $path }}"
{{ end }}
{{- end }}
)

// ensure the imports are used
Expand All @@ -42,7 +42,7 @@ var (

{{ range (externalEnums .) }}
_ = {{ pkg . }}.{{ name . }}(0)
{{ end }}
{{- end }}
)

{{- if fileneeds . "uuid" }}
Expand Down
2 changes: 1 addition & 1 deletion templates/goshared/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func (fns goSharedFuncs) externalEnums(file pgs.File) []pgs.Enum {
en = fld.Type().Element().Enum()
}

if en != nil && en.Package().ProtoName() != fld.Package().ProtoName() && fns.PackageName(en) != fns.PackageName(fld) {
if en != nil && fns.PackageName(en) != fns.PackageName(fld) {
out = append(out, en)
}
}
Expand Down