code: func (l *SingleFileStore) openNew() error {
  	err := os.MkdirAll(l.dir(), 0744)
  	if err != nil {
  		return fmt.Errorf("can't make directories for new logfile: %s", err)
  	}
  
  	name := l.filename()
  	mode := os.FileMode(0644)
  
  	// we use truncate here because this should only get called when we've moved
  	// the file ourselves. if someone else creates the file in the meantime,
  	// just wipe out the contents.
  	f, err := os.OpenFile(name, os.O_CREATE|os.O_RDWR|os.O_TRUNC, mode)
  	if err != nil {
  		return fmt.Errorf("can't open new logfile: %s", err)
  	}
  
  	l.file = f
  	l.size = 0
  	return nil
  }
docs: // openNew opens a new log file for writing, moving any old log file out of the
  // way.  This methods assumes the file has already been closed.