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

Conversation

thylong
Copy link
Contributor

@thylong thylong commented Mar 5, 2022

Please provide enough information so that others can review your pull request:

$ go generate ./... generates panic as import paths have changed over time.
This commit free this command execution from panics.

Explain the details for making this change. What existing problem does the pull request solve?

When running $ go generate ./..., the command panics with the following error message :

panic: open <parent_of_fiber_root_directory>/fiber/internal/encoder/vm/vm.go: no such file or directory

goroutine 1 [running]:
main.main()
        <parent_of_fiber_root_directory>/fiber/internal/go-json/cmd/generator/main.go:314 +0x6c
exit status 2
internal/go-json/cmd/generator/main.go:311: running "go": exit status 1

The culprits reside in the filepath.Join() statements in :

filepath.Join(repoRoot(), "internal", "encoder", pkg, "vm.go")
# and
filepath.Join("internal", "cmd", "generator")

# those constructed paths do not exist anymore !

By adding go-json directory in the join statements, the generated paths exists. The generator can now freely write/override the vm.go file 馃檪

go generate ./... generates panic as import paths have
probably changed over time. This commit free this command
from panics.
@efectn
Copy link
Member

efectn commented Mar 5, 2022

Thanks.

@efectn efectn merged commit df85b62 into gofiber:master Mar 5, 2022
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants