DEV Community

Discussion on: Blog Project with Go, Gin, MySQL and Docker - Part 1

Collapse
 
ngutu profile image
Nichita Gutu

With newer versions of Go go get is used to adjust dependencies. To install packages, CompileDaemon in this case, go install is used, so you'll need to change in your Dockerfile line
RUN go get github.com/githubnemo/CompileDaemon
to
RUN go install github.com/githubnemo/CompileDaemon
and it should work as it should

Collapse
 
tungnt profile image
Tom Nguyen

I use Go v.1.19 and I need two lines above to install CompileDaemon. Having just one of them is not enough.

RUN go get github.com/githubnemo/CompileDaemon
RUN go install github.com/githubnemo/CompileDaemon

Collapse
 
hugonorte profile image
hugonorte

The same happened here and I fixed using this line in my Dockerfile:
instead of
RUN go get github.com/githubnemo/CompileDaemon
Use
RUN go install -mod=mod github.com/githubnemo/CompileDaemon