Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I’m new to DO functions (using Go) and am really struggling with this. I’m trying to deploy a single function right now but I plan to add others - all of which will need to share some local libraries. I’m been trying to find a project structure or yml configuration that enables this but after almost two days I’m still stuck. I can build and run locally but when I try to deploy using doctl I get such as package common/models is not in GOROOT (/usr/local/go/src/common/models). My project structure is below. I have a shared package called “lib” that is shared among the functions, as well as other packages from the “common” module, all of which exist in a single workspace.
What do I need to do so that doctl knows where to find these packages when building?
repo
api
common
functions
functions
packages
bots
bot1
main.go
scrape.go
lib
objects.go
utilities.go
go.mod
go.sum
go.work
go.work.sum
Errors:
scrape.go:14:2: package api/common is not in GOROOT (/usr/local/go/src/api/common)
scrape.go:15:2: package api/handlers is not in GOROOT (/usr/local/go/src/api/handlers)
scrape.go:16:2: package api/logger is not in GOROOT (/usr/local/go/src/api/logger)
scrape.go:17:2: package common/models is not in GOROOT (/usr/local/go/src/common/models)
scrape.go:7:2: package functions/lib is not in GOROOT (/usr/local/go/src/functions/lib)
scrape.go:19:2: no required module provides package github.com/PuerkitoBio/goquery; to add it:
go get github.com/PuerkitoBio/goquery
scrape.go:20:2: no required module provides package github.com/labstack/gommon/log; to add it:
go get github.com/labstack/gommon/log
Roger Henman
Paul Adeyenuwo
wtrenker
Popescu Crina-Mariana
Setor Blagogee
daniel.carpenter01
Morzaram
Sai Aung Kaung Myat
alenn
Jake W
afdaldev