Skip to content

Commit

Permalink
Trimmed down types
Browse files Browse the repository at this point in the history
  • Loading branch information
ardan-bkennedy committed Apr 30, 2015
1 parent 2b24c4f commit 871bba2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 49 deletions.
31 changes: 6 additions & 25 deletions chapter9/listing01/listing01_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,26 @@ const failed = "\u2717"
// the buoy RSS document.
type Item struct {
XMLName xml.Name `xml:"item"`
PubDate string `xml:"pubDate"`
Title string `xml:"title"`
Description string `xml:"description"`
Link string `xml:"link"`
GUID string `xml:"guid"`
GeoRssPoint string `xml:"georss:point"`
}

// Image defines the fields associated with the image tag in
// the buoy RSS document.
type Image struct {
XMLName xml.Name `xml:"image"`
URL string `xml:"url"`
Title string `xml:"title"`
Link string `xml:"link"`
}

// Channel defines the fields associated with the channel tag in
// the buoy RSS document.
type Channel struct {
XMLName xml.Name `xml:"channel"`
Title string `xml:"title"`
Description string `xml:"description"`
Link string `xml:"link"`
PubDate string `xml:"pubDate"`
LastBuildDate string `xml:"lastBuildDate"`
TTL string `xml:"ttl"`
Language string `xml:"language"`
ManagingEditor string `xml:"managingEditor"`
WebMaster string `xml:"webMaster"`
Image Image `xml:"image"`
Items []Item `xml:"item"`
XMLName xml.Name `xml:"channel"`
Title string `xml:"title"`
Description string `xml:"description"`
Link string `xml:"link"`
PubDate string `xml:"pubDate"`
Items []Item `xml:"item"`
}

// Document defines the fields associated with the buoy RSS document.
type Document struct {
XMLName xml.Name `xml:"rss"`
Channel Channel `xml:"channel"`
URI string
}

// TestDownload tests if download web content is working.
Expand Down
30 changes: 6 additions & 24 deletions chapter9/listing02/listing02_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,20 @@ var feed = `<?xml version="1.0" encoding="UTF-8"?>
// the buoy RSS document.
type Item struct {
XMLName xml.Name `xml:"item"`
PubDate string `xml:"pubDate"`
Title string `xml:"title"`
Description string `xml:"description"`
Link string `xml:"link"`
GUID string `xml:"guid"`
GeoRssPoint string `xml:"georss:point"`
}

// Image defines the fields associated with the image tag in
// the buoy RSS document.
type Image struct {
XMLName xml.Name `xml:"image"`
URL string `xml:"url"`
Title string `xml:"title"`
Link string `xml:"link"`
}

// Channel defines the fields associated with the channel tag in
// the buoy RSS document.
type Channel struct {
XMLName xml.Name `xml:"channel"`
Title string `xml:"title"`
Description string `xml:"description"`
Link string `xml:"link"`
PubDate string `xml:"pubDate"`
LastBuildDate string `xml:"lastBuildDate"`
TTL string `xml:"ttl"`
Language string `xml:"language"`
ManagingEditor string `xml:"managingEditor"`
WebMaster string `xml:"webMaster"`
Image Image `xml:"image"`
Items []Item `xml:"item"`
XMLName xml.Name `xml:"channel"`
Title string `xml:"title"`
Description string `xml:"description"`
Link string `xml:"link"`
PubDate string `xml:"pubDate"`
Items []Item `xml:"item"`
}

// Document defines the fields associated with the buoy RSS document.
Expand Down

0 comments on commit 871bba2

Please sign in to comment.