Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 API for Go Documentation | 2025.2

# Shelve and unshelve files

The following is an example of how to shelve and unshelve files using P4 API for Go.

Copy

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    // Shelve files
    changeSpec, _ := p4api.RunFetch("change")
    changeSpec["Description"] = "Shelving changes"
    shelveResult, err := p4api.RunShelve(changeSpec)
    if err != nil {
        fmt.Println("Error shelving changes:", err)
    } else {
        fmt.Println("Shelve result:", shelveResult)
    }

    // Unshelve files
    _, err = p4api.Run("unshelve", "-s", "12345")
    if err != nil {
        fmt.Println("Error in unshelve:", err)
    }

Your search for returned results