goHike icon indicating copy to clipboard operation
goHike copied to clipboard

How to use it with dependencies?

Open dzpt opened this issue 6 years ago • 2 comments

My binary package have some dependencies installed from go get command. But i see it doesn't work after using deploy.sh.

There are some errors like:

cannot find package github.com/robfig/cron (using -importcfg)
cannot find package github.com/go-chi/chi/middleware (using -importcfg)

dzpt avatar Feb 22 '19 20:02 dzpt

@aaveidt Noted. Will reply you later.

atlas-comstock avatar Mar 05 '19 17:03 atlas-comstock

@aaveidt Go support this feature now, see: https://golang.org/cmd/go/#hdr-Build_modes

The 'go build' and 'go install' commands take a -buildmode argument which indicates which kind of object file is to be built. Currently supported values are:

-buildmode=archive
	Build the listed non-main packages into .a files. Packages named
	main are ignored.

-buildmode=c-archive
	Build the listed main package, plus all packages it imports,
	into a C archive file. The only callable symbols will be those
	functions exported using a cgo //export comment. Requires
	exactly one main package to be listed.

-buildmode=c-shared
	Build the listed main package, plus all packages it imports,
	into a C shared library. The only callable symbols will
	be those functions exported using a cgo //export comment.
	Requires exactly one main package to be listed.

-buildmode=default
	Listed main packages are built into executables and listed
	non-main packages are built into .a files (the default
	behavior).

atlas-comstock avatar Mar 27 '19 02:03 atlas-comstock