I'm new to Go, and I imagine this is an obvious situation for anyone who's worked with Go deployment in the past. In the most TL;DR sense, I built out a demo project from Scotch.IO for a simple todo list using Go (https://scotch.io/tutorials/create-a-single-page-app-with-go-echo-and-vue), and it works flawlessly on my machine, but it breaks in CircleCI when it attempts to import locally defined packages:
import (
"database/sql"
"net/http"
"strconv"
"go-todo/models" // <- This
"github.com/labstack/echo"
)
I know there's no real reason to deploy an app like this, but I'd like to understand it better before diving into larger projects where deployment is essential. The logs at the breakpoint read:
package go-todo/handlers: unrecognized import path "go-todo/handlers" (import path does not begin with hostname)
package go-todo/models: unrecognized import path "go-todo/models" (import path does not begin with hostname)
And while I grasp that the path is incomplete from a remote environment perspective, I also know that relative paths won't fix it, and I have to assume there's some environmental variable that my ignorance is making me blind to in this context.
It's also worth noting that all of the go get
calls for remote packages play nicely as expected.
Any help will be greatly appreciated. Refining my google searches is just bringing back the same stack of seemingly unrelated questions.