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

P4 API for Go Documentation | 2025.1

# Fetch and save client specifications

The following is an example of how to fetch and save client specifications with P4 API for Go.

Copy

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    // Fetch the client spec
    clientSpec, err := p4api.RunFetch("client", "my_client")
    if err != nil {
        fmt.Println("Error fetching client spec:", err)
        return
    }

    // Modify the client spec
    clientSpec["Root"] = "/new/workspace/path"

    // Save the updated client spec
    msg, err := p4api.RunSave("client", clientSpec)
    if err != nil {
        fmt.Println("Error saving client spec:", err)
    } else {
        fmt.Println("Client spec saved successfully:", msg.String())
    }

Your search for returned results