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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/gf: gf run main.go error #4125

Open
liuzhenrain opened this issue Jan 18, 2025 · 0 comments
Open

cmd/gf: gf run main.go error #4125

liuzhenrain opened this issue Jan 18, 2025 · 0 comments
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.

Comments

@liuzhenrain
Copy link

liuzhenrain commented Jan 18, 2025

Go version

go version: 1.23.5

GoFrame version

2.7.1

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

PS F:\goprojs\gftest> gf version
v2.8.3
Welcome to GoFrame!
Env Detail:
  GF Version(go.mod): v2.7.1
CLI Detail:
  Installed At: F:\gotools\gf.exe
  Built Go Version: go1.23.4
  Built GF Version: v2.8.3
  Git Commit: 2024-12-18 15:54:27 92eab81926dea3ef090905c8f4da267c84fd11a3
  Built Time: 2024-12-18 21:00:03
Others Detail:
  Docs: https://goframe.org
  Now : 2025-01-18T23:33:15+08:00

Run the following commands in order (Windows 10 PowerShell):

  1. mkdir gftest
  2. cd gftest
  3. gf init .
  4. gf run main.go

Other than that, no further actions are taken.

Then the following error occurs:

PS F:\goprojs\gftest> gf run main.go
build: main.go
`go build -o .\main.exe main.go`
build error:
The system cannot find the path specified.
exit status 1
deleted binary file: .\main.exe

What did you see happen?

I switched to cmd and Git Bash (MINGW64) on Windows 10, but the same error occurred.

I have tried downloading an older version of gf-cli (2.8.2) and also attempted to install gf-cli using the command go install github.com/gogf/gf/cmd/gf/v2@latest, but the same error occurred in both cases.

If I directly run the command go build -o .\main.exe main.go, a .main.exe file is generated in the current directory.

Attached is the output information from running the command gf run main.go --gf.debug=true.

run_error.txt

What did you expect to see?

The command can be executed normally.

@liuzhenrain liuzhenrain added the bug It is confirmed a bug, but don't worry, we'll handle it. label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.
Projects
None yet
Development

No branches or pull requests

1 participant