liteide icon indicating copy to clipboard operation
liteide copied to clipboard

BuildAndRun failed to run if package name inside go.mod different with foldername

Open radiaku opened this issue 2 years ago • 4 comments

Spec

LiteIde x38.2. qt 5.15.2 64bit go1.19.4 windows 10 home x64

Env

set GO111MODULE= set GOARCH=386 set GOBIN= set GOCACHE=C:\Users\ASUS\AppData\Local\go-build set GOENV=C:\Users\ASUS\AppData\Roaming\go\env set GOEXE=.exe set GOEXPERIMENT= set GOFLAGS= set GOHOSTARCH=386 set GOHOSTOS=windows set GOINSECURE= set GOMODCACHE=C:\Users\ASUS\go\pkg\mod set GONOPROXY= set GONOSUMDB= set GOOS=windows set GOPATH=C:\Users\ASUS\go set GOPRIVATE= set GOPROXY=https://proxy.golang.org,direct set GOROOT=c:\go set GOSUMDB=sum.golang.org set GOTMPDIR= set GOTOOLDIR=c:\go\pkg\tool\windows_386 set GOVCS= set GOVERSION=go1.19.4 set GCCGO=gccgo set GO386=sse2 set AR=ar set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD=NUL set GOWORK= set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m32 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\ASUS\AppData\Local\Temp\go-build1935397992=/tmp/go-build -gno-record-gcc-switches

Problem

I hope that LiteIDE has a certain feature that I'm missing. Specifically, when I use the terminal command 'go mod init name_project' instead of the shortcut in LiteIDE .

If my package name is different from the folder name, and I use BuildAndRun, the build succeeds but fails to run.

It would be helpful if LiteIDE could read the 'go.mod' file and run based on the package name inside it instead of relying solely on the folder name.

Oh btw the Run is failed too. but Filerun is working properly.

radiaku avatar Feb 18 '23 11:02 radiaku

modify BuildConfig custom TARGETBASENAME to mod project name.

visualfc avatar Feb 18 '23 13:02 visualfc

I delete the go.mod and redoing it again using shortcut. It's just that I wished liteide can have this feature.

radiaku avatar Feb 19 '23 02:02 radiaku

use build configure custome

1 2

visualfc avatar Feb 19 '23 03:02 visualfc

Thanks for replying, Yes I know if liteide have this feature.

maybe its more cool we can configure in custom build, for shortcut reading go.mod package instead folder name. something like $(BUILD_DIR_MOD) something like this.

radiaku avatar Feb 20 '23 04:02 radiaku