Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Fix go-json generator. #1806

Merged
merged 1 commit into from Mar 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/go-json/cmd/generator/main.go
Expand Up @@ -268,7 +268,7 @@ func (t OpType) FieldToOmitEmptyField() OpType {
}); err != nil {
return err
}
path := filepath.Join(repoRoot(), "internal", "encoder", "optype.go")
path := filepath.Join(repoRoot(), "internal", "go-json", "encoder", "optype.go")
buf, err := format.Source(b.Bytes())
if err != nil {
return err
Expand All @@ -290,7 +290,7 @@ func generateVM() error {
f.Name.Name = pkg
var buf bytes.Buffer
printer.Fprint(&buf, fset, f)
path := filepath.Join(repoRoot(), "internal", "encoder", pkg, "vm.go")
path := filepath.Join(repoRoot(), "internal", "go-json", "encoder", pkg, "vm.go")
source, err := format.Source(buf.Bytes())
if err != nil {
return err
Expand All @@ -304,7 +304,7 @@ func generateVM() error {

func repoRoot() string {
_, file, _, _ := runtime.Caller(0)
relativePathFromRepoRoot := filepath.Join("internal", "cmd", "generator")
relativePathFromRepoRoot := filepath.Join("internal", "go-json", "cmd", "generator")
return strings.TrimSuffix(filepath.Dir(file), relativePathFromRepoRoot)
}

Expand Down