Go / geany: configure build command

With the old go version, I can configure the build command in geany as

go install "%d"

But it seems that in Go1 you cannot provide go installan absolute path.

So I need a command to let me run

go install mypackagename

when my edited file

/some/path/to/my/project/go/src/mypackagename/editedfile.go

What can I set in the settings to get this?

Please note that I am linux noob and that there may be a trivial solution using a combination of standard shell commands.

+3
source share
4 answers

I would try something like

cd "%d" && go install

It changes the current working directory to the directory supplied by geany and starts go installif the directory change was successful.

, geany . , cd ( ), .

geany.

+1

nemo , , Geany golang.

(F8):

go build "%f"

(F9):

cd "%d" && go install

:

cd "%d" && go test

(F5):

go run "%f"

, Go Geany ( ) .

+1

. : cd/path/to/root/code/dir; go install mypackagename

0
go install import-path

sets $ GOPATH / src / import-path. The last import-path element must match the package name in the source (s) in this directory.

-2
source

All Articles