Last updated: Dec-11-2024
On this page:
Overview
Learn how to install and configure the Cloudinary Go SDK in your Go environment. This will enable you to utilize Cloudinary for uploading, managing, and displaying assets in your applications.
Video tutorial
Tutorial contents
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
Introduction
0:00 | The Cloudinary Go SDK gives you a way to handle images and videos at scale, providing transformation, optimization and delivery capabilities that you can integrate seamlessly into your Go applications. |
Install the Go SDK
0:17 | To install the Cloudinary Go SDK, ensure you're in the directory where your Go module was initialized using go mod init . Use the go get command to add the Cloudinary Go library from GitHub to your project. |
Configure Cloudinary
0:29 | To configure Cloudinary, begin by creating a Cloudinary instance. Import the Cloudinary library from GitHub and use the cloudinary.New function to create the instance. Store this instance in a variable, such as cld , and include error handling. |
my_file.go
Add credentials
0:48 | To keep your credentials secure:
.env file, replacing the placeholder values with your actual credentials. |
my_file.go
Retrieve an image delivery URL from Cloudinary
2:03 | With your Cloudinary instance configured, you can generate a delivery URL for an image in your product environment:
|
my_file.go
Run the code
2:51 | After writing the code, run it to see the delivery URL for the cld-sample image. This confirms that your Cloudinary instance was successfully created and used. You can also open the URL in a browser to view the image in your product environment. |
Keep learning
Related topics
- Learn more about the Go SDK.
- Watch more Dev Hints videos on the Cloudinary YouTube channel.
If you like this, you might also like...
Optimization Tips
Tips for delivering optimized imagesCreate Upload Presets
Streamline media uploads using signed upload presetsAuto Upload
Automatically upload remote images and videos to Cloudinary
Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.
✖️