package main
import (
"encoding/xml"
"fmt"
)
type Property struct {
Name string `xml:"name,attr"`
Value string `xml:",chardata"`
}
type Object struct {
Properties []Property `xml:"PROPERTY"`
Basetype string `xml:"basetype,attr"`
Name string `xml:"name,attr"`
Oid int `xml:"oid,attr"`
}
type Response struct {
XMLName xml.Name `xml:"RESPONSE"`
Objects []Object `xml:"OBJECT"`
}
func main() {
data := []byte(`<RESPONSE>
<OBJECT basetype="status" name="status" oid="1">
<PROPERTY name="response-type">success</PROPERTY>
<PROPERTY name="response-type-numeric">0</PROPERTY>
<PROPERTY name="response">0f738648db95bb1f6ca37f6b8b5aafa8</PROPERTY>
<PROPERTY name="return-code">1</PROPERTY>
</OBJECT>
</RESPONSE>`)
var res Response
err := xml.Unmarshal(data, &res)
if err != nil {
panic(err)
}
fmt.Printf("%+v\n", res)
}
Get-DatabaseAvailabilityGroup | Set-DatabaseAvailabilityGroup -AllowCrossSiteRpcClientAccess $True
В книге идентичный пример работает почему-то
mysql> CREATE TABLE album ( artist_id SMALLINT(5) NOT NULL, album_id SMALLINT(4) NOT NULL AUTO_INCREMENT, album_name CHAR(128) DEFAULT NULL, PRIMARY KEY (artist_id, album_id) ) engine=innodb;
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key
mysql> CREATE TABLE album ( artist_id SMALLINT(5) NOT NULL, album_id SMALLINT(4) NOT NULL AUTO_INCREMENT, album_name CHAR(128) DEFAULT NULL, PRIMARY KEY (artist_id, album_id) ) engine=myisam;
Query OK, 0 rows affected (0,00 sec)
mysql>
cd /var/cache/debconf
rm *.dat
apt-get update && apt-get upgrade