fix struct variable scopes
This commit is contained in:
parent
2f3a4aee36
commit
5cd3eeb765
|
@ -10,13 +10,13 @@ import (
|
|||
type SiteId string
|
||||
|
||||
type SiteEntry struct {
|
||||
id SiteId
|
||||
name string
|
||||
webmaster *SiteWebmaster
|
||||
url string
|
||||
dateAdded time.Time
|
||||
next SiteId
|
||||
prev SiteId
|
||||
Id SiteId
|
||||
Name string
|
||||
Webmaster *SiteWebmaster
|
||||
Url string
|
||||
DateAdded time.Time
|
||||
Next SiteId
|
||||
Prev SiteId
|
||||
}
|
||||
|
||||
|
||||
|
@ -25,33 +25,33 @@ func NewSiteEntry(siteName, webmasterEmail, siteUrl string) SiteEntry {
|
|||
// previous site is the last one inserted
|
||||
// retrieve webmaster from database or create if it doesn't exist
|
||||
return SiteEntry{
|
||||
id: SiteId(uuid.NewString()),
|
||||
name: siteName,
|
||||
url: siteUrl,
|
||||
dateAdded: time.Now(),
|
||||
Id: SiteId(uuid.NewString()),
|
||||
Name: siteName,
|
||||
Url: siteUrl,
|
||||
DateAdded: time.Now(),
|
||||
}
|
||||
}
|
||||
|
||||
type WebmasterId string
|
||||
|
||||
type SiteWebmaster struct {
|
||||
id WebmasterId
|
||||
name string
|
||||
email string
|
||||
Id WebmasterId
|
||||
Name string
|
||||
Email string
|
||||
}
|
||||
|
||||
func NewSiteWebmaster(name, email string) SiteWebmaster {
|
||||
return SiteWebmaster{ id: WebmasterId(uuid.NewString()),
|
||||
name: name,
|
||||
email: email,
|
||||
return SiteWebmaster{ Id: WebmasterId(uuid.NewString()),
|
||||
Name: name,
|
||||
Email: email,
|
||||
}
|
||||
}
|
||||
|
||||
type Webring struct {
|
||||
Db *sql.DB
|
||||
Length int
|
||||
first SiteId
|
||||
last SiteId
|
||||
length int
|
||||
}
|
||||
|
||||
// Retrieve the first website added to the webring
|
||||
|
|
Loading…
Reference in New Issue