Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write_file @doc, @spec and implementation do not match #20

Closed
schnittchen opened this issue Dec 17, 2020 · 2 comments
Closed

write_file @doc, @spec and implementation do not match #20

schnittchen opened this issue Dec 17, 2020 · 2 comments
Assignees

Comments

@schnittchen
Copy link

  @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
@tlux
Copy link
Owner

tlux commented Dec 17, 2020

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. :)

@tlux tlux self-assigned this Dec 17, 2020
@tlux
Copy link
Owner

tlux commented Dec 17, 2020

fixed in 8004b42

@tlux tlux closed this as completed Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants