Skip to content
This repository was archived by the owner on Oct 5, 2023. It is now read-only.
This repository was archived by the owner on Oct 5, 2023. It is now read-only.

Creating client without IPFS_PATH leads to nil #7

@hinshun

Description

@hinshun

If the default ~/.ipfs, IPFS_PATH env var, or ipfspath function arg passed to NewPathApi is a non-existent directory, it will return nil error and nil client.

A common pattern in golang is this:

cln, err := httpapi.NewLocalApi()
if err != nil {
  return err
}

// cln.Unixfs().Add ...

But that becomes a nil pointer reference. Curious why os.IsNotExist errors are hidden here:
https://github.com/ipfs/go-ipfs-http-client/blob/master/api.go#L56-L59

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions