You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cacheOnReadFs.go
    path of file: ./repos/sealer/vendor/github.com/spf13/afero
    
    the code of the file until where you have to start completion: package afero

import (
	"os"
	"syscall"
	"time"
)

// If the cache duration is 0, cache time will be unlimited, i.e. once
// a file is in the layer, the base will never be read again for this file.
//
// For cache times greater than 0, the modification time of a file is
// checked. Note that a lot of file system implementations only allow a
// 
    
func (u *CacheOnReadFs) Chown(name string, uid, gid int) error {
	st, _, err := u.cacheStatus(name)
	if err != nil {
		return err
	}
	switch st {
	case cacheLocal:
	case cacheHit:
		err = u.base.Chown(name, uid, gid)
	case cacheStale, cacheMiss:
		if err := u.copyToLayer(name); err != nil {
			return err
		}
		err = u.base.Chown(name, uid, gid)
	}
	if err != nil {
		return err
	}
	return u.layer.Chown(name, uid, gid)
}