atlas-comstock / goHike

A script of Go1.7 binary package generator, with a detail example.
23 stars 6 forks source link

How to use it with dependencies? #3

Open dzpt opened 5 years ago

dzpt commented 5 years ago

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)
atlas-comstock commented 5 years ago

@aaveidt Noted. Will reply you later.

atlas-comstock commented 5 years ago

@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).