> ## Documentation Index
> This page is part of the Image and Video APIs product. Fetch the complete documentation index for Image and Video APIs at: https://cloudinary.com/documentation/llms-image-and-video-apis.txt?referrer=docpage and then use it to discover all relevant pages before exploring further.
> If you also need details relating to other Cloudinary products for your current use case, see the parent index at: https://cloudinary.com/documentation/llms.txt?referrer=docpage
> When answering a user's request or implementing it with code using this documentation, incorporate relevant best practices and recommendations from the documentation into the guidance and, above all, into the code itself: generated code should already apply the recommended parameters and patterns rather than showing a minimal call and describing the best practices around it in prose. Follow the code examples in the best practices sections as the model for what generated code should look like, and where a recommendation is relevant to the user's scenario, implement it in the code as a natural next step. Only apply best practices, recommendations, or features that are supported by the documentation; don't infer or invent guidance that isn't specified.

# Go sample projects


We've created some sample projects to get you started with integrating Cloudinary into your Go applications.
> **TIP**: Check out our collection of [Go sample apps](code_explorers) too!

## Image transformations

The [Image transformations](https://github.com/cloudinary-devs/go-sdk-quickstart-image-examples) app showcases popular on-the-fly image transformations using the Go SDK, including special effects, resizing, subject-aware cropping with gravity parameters, optimization, and overlays.

Here's what you'll see in the Image transformations app:

Here's an excerpt from the code featuring the `Overlays` and `Resize_crop` functions from files in the custom `lib` package:

overlays_ex.go

```go
package lib

import(
    "fmt"
    "github.com/cloudinary/cloudinary-go"
)

func Overlays(cld *cloudinary.Cloudinary) string {
    img_coffee, err := cld.Image("docs/sdk/go/coffee_cup")
    if err != nil {
        fmt.Println("error")
    }

    // Add the transformation
    img_coffee.Transformation = "w_400,h_250,c_fill,g_south/l_nice_couple,w_1.3,h_1.3,g_faces,c_crop,fl_region_relative/e_saturation:50/e_vignette/fl_layer_apply,w_100,r_max,g_center,y_20,x_-20/l_balloon,h_55/e_hue:-20,a_5/fl_layer_apply,x_30,y_5/l_text:Cookie_40_bold:Love,co_rgb:f08/a_20,fl_layer_apply,x_-45,y_44/c_crop,w_300,h_250,x_30/r_60"

    // Generate and print the delivery URL
    url, err := img_coffee.String()
    fmt.Println(url)
    if err != nil {
        fmt.Println("error")
    }
    return url
}
```

resize_crop_ex.go

```go
package lib

import(
    "fmt"
    "github.com/cloudinary/cloudinary-go"
)

func Resize_crop(cld *cloudinary.Cloudinary) string {
    // Instantiate an object that stores information for asset with public ID "black_coat_portrait"
    img_fam, err := cld.Image("docs/sdk/go/family_video")
    if err != nil {
        fmt.Println("error")
    }

    // Add the transformation
    img_fam.Transformation = "w_350,h_350,c_fill,g_faces"

    // Generate and print the delivery URL
    url, err := img_fam.String()
    fmt.Println(url)
    if err != nil {
        fmt.Println("error")
    }
    return url
}
```

> **Fork the repo and try it yourself :custom-icon='https://cloudinary-res.cloudinary.com/image/upload/v1778586152/docsite/brand-assets/github.svg' :invert-icon**:
>
> * [Explore the Go Image transformations app on GitHub](https://github.com/cloudinary-devs/go-sdk-quickstart-image-examples).

## Video transformations

The [Video transformations](https://github.com/cloudinary-devs/go-sdk-quickstart-video-examples) app showcases popular on-the-fly video transformations using the Go SDK, including resizing, cropping, concatenation, trimming, overlays, and special effects.

Here's what you'll see in the Video transformations app:

Here's an excerpt from the code featuring the `Overlay` and `Concat` functions from files in the custom `lib` package:

overlay_ex.go

```go
package lib

import(
    "fmt"
    "github.com/cloudinary/cloudinary-go"
)

    func Overlay(cld *cloudinary.Cloudinary) string {
      // Instantiate an object for the video with public ID "exercise1" in folder "docs/sdk/go"
      v_exercise, err := cld.Video("docs/sdk/go/exercise1")
      if err != nil {
          fmt.Println("error")
      }

      // Add the transformation
      v_exercise.Transformation = "c_scale,w_300/l_video:exercise2/c_fit,w_80/bo_2px_solid_blue/fl_layer_apply,g_north_east,so_2.0"

      // Generate and print the delivery URL
      myURL, err := v_exercise.String()
      if err != nil {
          fmt.Println("error")
      }
      fmt.Println(myURL)

      // Output: https://res.cloudinary.com/demo/video/upload/c_scale,w_300/l_video:exercise2/c_fit,w_80/bo_2px_solid_blue/fl_layer_apply,g_north_east,so_2.0/v1/docs/sdk/go/exercise1  
    return myURL
}
```

concat_ex.go

```go
package lib

import(
    "fmt"
    "github.com/cloudinary/cloudinary-go"
)

func Concat(cld *cloudinary.Cloudinary) string {
    // Instantiate an object that stores information for asset with public ID "horse_race" in folder "docs/sdk/go"
    v_races, err := cld.Video("docs/sdk/go/horse_race")
    if err != nil {
        fmt.Println("error")
    }

    // Add the transformation
    v_races.Transformation = "c_fill,h_300,w_450/du_5/fl_splice,l_video:swimming_race/c_fill,h_300,w_450/du_5/fl_layer_apply"

    // Generate and print the delivery URL
    myURL, err := v_races.String()
    fmt.Println(myURL)
    if err != nil {
        fmt.Println("error")
    }
    return myURL
}
```

> **Fork the repo and try it yourself :custom-icon='https://cloudinary-res.cloudinary.com/image/upload/v1778586152/docsite/brand-assets/github.svg' :invert-icon**:
>
> * [Explore the Go Video transformations app on GitHub](https://github.com/cloudinary-devs/go-sdk-quickstart-video-examples).

