jzelinskie / geddit

golang reddit api wrapper
BSD 3-Clause "New" or "Revised" License
163 stars 58 forks source link

export new submission #14

Closed collinglass closed 9 years ago

collinglass commented 9 years ago

There are cases where one might want to do the following:

var ns *reddit.NewSubmission

switch t.Type {
case "link":
    ns = reddit.NewLinkSubmission(t.SubReddit, t.Title, t.Url, true, nil)
case "text":
    ns = reddit.NewTextSubmission(t.SubReddit, t.Title, t.Text, true, nil)
default:
    return
}
jzelinskie commented 9 years ago

Good point! Thanks for the contribution!

collinglass commented 9 years ago

No problem, thanks for the prompt response