Пример #1
0
func properPlace(p Place) *Place {
	if zero, _ := is.Zero(p); zero {
		// we ignore the error because Place has no array fields
		return nil
	} else {
		return &p
	}
}
Пример #2
0
func properEntities(tweet Tweet) *ArchiveEntities {
	if zero, _ := is.Zero(tweet.Entities); zero {
		// we ignore the error because Entities has no array fields
		return nil
	} else {
		return &ArchiveEntities{
			tweet.Entities.Hashtags,
			tweet.Entities.Urls,
			tweet.Entities.User_mentions,
			convertMediaToArchive(tweet.Entities.Media),
		}
	}
}