code: func findSize(v interface{}) (size int64, ok bool) {
  	if fi, ok := v.(*os.File); ok {
  		v, _ = fi.Stat()
  	}
  	if sz, ok := v.(interface {
  		Size() int64
  	}); ok {
  		return sz.Size(), true
  	}
  	// For bytes.Reader, strings.Reader, etc:
  	if li, ok := v.(interface {
  		Len() int
  	}); ok {
  		ln := int64(li.Len()) // unread portion, typically
  		// If it's also a seeker, remove add any seek offset:
  		if sk, ok := v.(io.Seeker); ok {
  			if cur, err := sk.Seek(0, 1); err == nil {
  				ln += cur
  			}
  		}
  		return ln, true
  	}
  	return 0, false
  }
docs: // findSize checks if v is an *os.File or if it has
  // a Size() int64 method, to find its size.
  // It returns 0, false otherwise.