nit: return concrete types
This is generally considered the "better" way to do things in go. It also allows us to expose functions like `request` at some point without changing the API interface itself. This commit was moved from ipfs/go-ipfs-http-client@524e5d82e6bcd2c4956151a4811addad656d7bf0
Steven Allen committed
Mar 26, 2019 at 16:54 UTC
e76ecd30384799dfe388671ebd153e88903d9388
1 file changed
+2
-2
client/httpapi/api.go
+2
-2
@@ -39,7 +39,7 @@ type HttpApi struct {
39
//
40
// Daemon api address is pulled from the $IPFS_PATH/api file.
41
// If $IPFS_PATH env var is not present, it defaults to ~/.ipfs
42
-func NewLocalApi() (iface.CoreAPI, error) {
42
+func NewLocalApi() (*HttpApi, error) {
43
baseDir := os.Getenv(EnvDir)
44
if baseDir == "" {
45
baseDir = DefaultPathRoot
@@ -50,7 +50,7 @@ func NewLocalApi() (iface.CoreAPI, error) {
50
51
// NewPathApi constructs new HttpApi by pulling api address from specified
52
// ipfspath. Api file should be located at $ipfspath/api
53
-func NewPathApi(ipfspath string) (iface.CoreAPI, error) {
53
+func NewPathApi(ipfspath string) (*HttpApi, error) {
54
a, err := ApiAddr(ipfspath)
55
if err != nil {
56
if os.IsNotExist(err) {