Fixes for New() methods
This commit is contained in:
parent
88b3d7e159
commit
7d49b2cb25
12
channel.go
12
channel.go
@ -57,10 +57,6 @@ func initChannel() *Channel {
|
||||
LastBuildDate: now,
|
||||
}
|
||||
|
||||
channel.wg.Add(1)
|
||||
go channel.start()
|
||||
channel.wg.Wait()
|
||||
|
||||
return channel
|
||||
}
|
||||
|
||||
@ -92,7 +88,13 @@ func (c *Channel) check() error {
|
||||
}
|
||||
|
||||
func NewChannel() *Channel {
|
||||
return initChannel()
|
||||
channel := initChannel()
|
||||
|
||||
channel.wg.Add(1)
|
||||
go channel.start()
|
||||
channel.wg.Wait()
|
||||
|
||||
return channel
|
||||
}
|
||||
|
||||
func (c *Channel) AddCategory(category string) {
|
||||
|
12
item.go
12
item.go
@ -43,10 +43,6 @@ func initItem() *Item {
|
||||
PubDate: time.Now().Format(time.RFC1123Z),
|
||||
}
|
||||
|
||||
item.wg.Add(1)
|
||||
go item.start()
|
||||
item.wg.Wait()
|
||||
|
||||
return item
|
||||
}
|
||||
|
||||
@ -66,7 +62,13 @@ func (i *Item) check() error {
|
||||
}
|
||||
|
||||
func NewItem() *Item {
|
||||
return initItem()
|
||||
item := initItem()
|
||||
|
||||
item.wg.Add(1)
|
||||
go item.start()
|
||||
item.wg.Wait()
|
||||
|
||||
return item
|
||||
}
|
||||
|
||||
func (i *Item) AddCategory(category string) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user