Build your Golang code with Go Modules

You can now build your go projects with go modules! Please take a look at our Go modules documentation.

At the begining of Go's adoption, the build tools available were goinstall and then go get. It worked simply, but versioning was not managed. Developers started vendoring libs, it started to be a bit messy. The Go community addressed this problem with different third-party builds and dependencies management tools. And then came the official answer from the Go team: Go Modules. And we support it on Clever Cloud \o/.

How to Deploy

The default build tool is still go get. So to choose go modules you will need the following environment variable: CC_GO_BUILD_TOOL=gomod

Please make sure your go.mod file is at the root of your repository alongside main.go. If you have a different entrypoint you can specify it with the environment variable CC_GO_PKG=./path/to/entrypoint.go

If you follow those two advices, everything should go well and you will have your deployed go application on Clever Cloud. We hope you will enjoy using it. Please let us know if you have any other suggestions to make our golang support better.

Happy coding!


À lire également

Deploy llama, mistral, openchat or your own model on Clever Cloud

If AI has been in the news recently, it's mainly through large language models (LLMs), which require substantial computing power for training or inference. Thus, it's common to see developers using them via turnkey APIs, as we did in a previous article. But this is changing thanks to more open and efficient models and tools, which you can easily deploy on Clever Cloud.

Our consortium, InfrateX, wins Simpl

The InfrateX Consortium, led by Sopra Steria with NTT Data and including Clever Cloud as a member, has won the significant contract Simpl.
Company Press

Our end-of-year events

The end of the year is already shaping up to be full of events, trade…