Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,35 @@
package main
import (
"encoding/xml"
"fmt"
)
// Function required by task description.
func xRemarks(r CharacterRemarks) (string, error) {
b, err := xml.MarshalIndent(r, "", " ")
return string(b), err
}
// Task description allows the function to take "a single mapping..."
// This data structure represents a mapping.
type CharacterRemarks struct {
Character []crm
}
type crm struct {
Name string `xml:"name,attr"`
Remark string `xml:",chardata"`
}
func main() {
x, err := xRemarks(CharacterRemarks{[]crm{
{`April`, `Bubbly: I'm > Tam and <= Emily`},
{`Tam O'Shanter`, `Burns: "When chapman billies leave the street ..."`},
{`Emily`, `Short & shrift`},
}})
if err != nil {
x = err.Error()
}
fmt.Println(x)
}