code: func isInvalid(err error) bool {
  	pe, ok := err.(*os.PathError)
  	if !ok {
  		return false
  	}
  
  	errstr := pe.Err.Error()
  	return errstr == errInvalidUnix || errstr == errInvalidWindows
  }
docs: // isInvalid checks whether an error is an os.PathError with an os.ErrInvalid
  // error inside. It also checks for the windows error, which is different from
  // os.ErrInvalid.