code: func updateStateFile(state *State, t *tail.Tail, file string, stateFh *os.File) {
  	logStat := unix.Stat_t{}
  	unix.Stat(file, &logStat)
  	currentPos, err := t.Tell()
  	if err != nil {
  		return
  	}
  	state.INode = uint64(logStat.Ino)
  	state.Offset = currentPos
  	out, err := json.Marshal(state)
  	if err != nil {
  		return
  	}
  	stateFh.Truncate(0)
  	out = append(out, '\n')
  	stateFh.WriteAt(out, 0)
  	stateFh.Sync()
  }
docs: // updateStateFile updates the state file once per second with the current
  // values for the logfile's inode number and offset