Search Gear Notes

Search Gear #20 Cleaning Up

Cleaning up those nasty files func (tw *twitter) cleanUp(entity string) (string, error) { if entity == “” { entity = “myHome” } cleanTime := time.Now().AddDate(0, 0, -2) fileName := strings.Join([]string{entity, “_”, cleanTime.Format(“2006-01-02”), “.json”}, “”) if err := os.Remove(fileName); err != nil { log.Println(“Failed to”, err) } return fileName, nil }   So why not have…

Advertisement