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.

Hey everyone!
So I am playing around with serverless functions and Go but as soon as I add a module from Github the build.sh script fails. Here is a minimal example:
package main
import (
"net/http"
"github.com/digitalocean/godo"
)
type Request struct {
Token string `json:"token"`
}
type Response struct {
StatusCode int `json:"statusCode,omitempty"`
Body string `json:"body,ommitempty"`
}
func Main(in Request) (*Response, error) {
client := godo.NewFromToke(in.Token)
return &Response{
StatusCode: http.StatusOK,
Body: "Yay!",
}, nil
}
The error when executing doctl serverless deploy <folder> is
Deploying '/user/sample/test'
to namespace '...'
on host '...'
Submitted action 'test' for remote building and deployment in runtime go:default (id: ...)
Transcript of remote build session for 'test':
Output of failed build in /tmp/slices/builds/.../sample_test/2022-07-23T22-30-16.224Z/packages/sample/test
initializing modules
go: creating new go.mod: module exec
go: to add module requirements and sums:
go mod tidy
building
test.go:6:2: no required module provides package github.com/digitalocean/godo; to add it:
go get github.com/digitalocean/godo
Failures:
Error: While deploying action 'sample/test': './build.sh' exited with code 1
Does anyone have an idea what I am doing wrong? Thanks a lot for the help I really appreciate it :)
Roger Henman
Roger Henman
Paul Adeyenuwo
wtrenker
Popescu Crina-Mariana
Setor Blagogee
daniel.carpenter01
Morzaram
Sai Aung Kaung Myat
alenn
Jake W