tlux / sftp_client

An Elixir SFTP Client that wraps Erlang's ssh and ssh_sftp.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

write_file @doc, @spec and implementation do not match

schnittchen opened this issue · comments

  @doc """
  Reads a file from the server, and returns the data as String.
  """
  @spec write_file(Conn.t(), Path.t(), String.t() | [String.t()]) ::
          :ok | {:error, SFTPClient.error()}
  def write_file(%Conn{} = conn, path, data) when is_binary(data) do
    write_file(conn, path, [data])
  end
  • returns a string according to @doc
  • returns :ok or {:error, _} according to @spec
  • data is_binary according to implementation
  • data can be String.t or [String.t] according to @spec

Hello, thanks for creating this issue! The docs are wrong. Seems to be a copy-and-paste error (these are the docs for one of the read_file functions). I'm going to fix this asap. :)