// Create a new empty ObjectList objList := &hcl.ObjectList{} // Add a new key-value pair to the list objList.Items = append(objList.Items, &hcl.ObjectItem{ Key: hcl.MustNewLiteral("foo", ""), Val: hcl.MustNewLiteral("bar", ""), }) // Check the length of the ObjectList if len(objList.Items) > 0 { // Do something with the first item in the list firstItem := objList.Items[0] fmt.Printf("Key: %v, Value: %v\n", firstItem.Key.Value(), firstItem.Val.Value()) }In this example, we create a new ObjectList and add a single key-value pair to it. We then check the length of the list and output the key and value of the first item if it exists. Overall, ObjectList is an essential data structure for working with HCL syntax trees in Go. With its flexibility and power, it makes it easy to manipulate HCL code programmatically.