Securing-DevOps/invoicer-chapter2

cannot load package

JasonDuquain opened this issue · 3 comments

I am following the instructions in chapter 2 and in the readme.md file to setup my environment. I have registered for circleCI and docker. I have imported my forked invoicer app and setup a docker repo and added the DOCKER_USER and DOCKER_PASS to the project settings. I have updated the working directory in my config.yml to: /go/src/github.com/jasonduquain/invoicer-chapter2. When I trigger a rebuild I get the following error in the 'testing application' section of circleCI:

can't load package: package github.com/JasonDuquain/invoicer-chapter2: cannot find package "github.com/JasonDuquain/invoicer-chapter2" in any of:
/usr/local/go/src/github.com/JasonDuquain/invoicer-chapter2 (from $GOROOT)
/go/src/github.com/JasonDuquain/invoicer-chapter2 (from $GOPATH)
Exited with code 1

I have searched around and maybe I need to run some go commands in order to get a bulidable source?:

hu17889/go_spider#26

I tried intalling go and doing the equivelent commands for this app but I get errors when running them and I am not even sure if this needs to be done.

Can you assist at all with this? I am running Windows 10 and if you need any output from the circleCI failure let me know. I should also mention I am a security guy with node/express/mongo/react experience but none with Go so I may be missing something that is obvious and if so please forgive my ignorance.

Have you followed the golang installation instructions from https://golang.org/doc/install ?
The MSI installer sets the environment variables for you. You'll need GOPATH in particular.

Thank you. Sorry for the delayed response. I went through those instructions and confirmed the GOPATH is in my environment variable. I also created the sample 'hello' program to confirm it is working correctly and it ran. It does state that "You can run go install to install the binary into your workspace's bin directory or go clean -i to remove it." Maybe I need to do this with the invoicer app? I have attached a screenshot for reference that shows the environment variable, where the invoicer is located and the contents of c:\go\bin. I will keep playing around with it but if you see anything in the screenshot that looks incorrect please let me know. Thank you again for your help.
go

I uninstalled and resinstalled go and now the build is successful. I am sure I used the MSI the first time so I am not sure why that is but glad it is working. Am hopeful I can get the rest of the environment working properly without issues so I can follow up with the remaining chapters in securing the application. Thanks for looking into this.